Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Area Question 1

Status
Not open for further replies.

fmrock

Programmer
Sep 5, 2006
510
US
I have a project I am working on. I have the page set to 100% height and width. I have a text area box on the right side that (if possible) I would like the height to grow/shirnk to the size of the table cell that it is in.

Is this possible? I found a few things online but none have worked.

Code:
<textarea style="height:100%" name="Test"></textarea>
 
I even tried in a blank page with nothing but the text area, with no luck.

Then I triend putting it in a table with a 100% height

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table height="100%" width="500" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="100%"><textarea style="height:100%" name="Test"></textarea></td>
  </tr>
</table>


</body>
</html>
 
Unless the parent table cell has height specified, percentage height (such as 100%) will be ignored and replaced by height: auto; which means the height of the content inside. Either give the parent container a specific height or textarea a pixel height.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Hi

Your code works as it should. The [tt]textarea[/tt] fills the entire [tt]table[/tt] cell.

Please note that the [tt]table[/tt] tag has no height attribute. So if you want to have the [tt]table[/tt] as high as the available vertical space, then remove the [tt]doctype[/tt]. That way the browsers will know that the page is a mess and will not try to render it as valid HTML document.

Feherke.
 
feherke,

The table tag has a height of 100% The goal of this project is to have the end user not have to scroll at all on this page.

Also, Not sure but why is the HTML a mess on this page?

What would be a better way of doing this?
 
Hi

fmrock said:
The table tag has a height of 100%
Certainly your [tt]table[/tt] tag has it. But the W3C specification for the [tt][/tt] tag has no height attribute.
fmrock said:
Also, Not sure but why is the HTML a mess on this page?
Because it is invalid. When it has 3 markup errors the "mess" word sounds quite appropriate. Try to convince any other document viewer software to forgive 3 structural errors. They will refuse. I say the browsers should do the same.
fmrock said:
What would be a better way of doing this?
CSS design. Use the [tt]table[/tt]s for tabular data representation only.

Feherke.
 
Feherke,

I have validated my whole page with Dreamweaver CS3 and fixed all of the errors. Removing the height references.

Do you have any examples of CSS design?

The page I am building is somewhat complicated, because its a page to view medical charts (tiff) images. So on the left side of the page, the tiff viewer (Browswer Plugin) shows the chart. on the right side, there is information about the chart, and a form where the user can update certian information. This is where the textarea box is.

Like i mentioned earlier, the goal is to not have the user have to scroll up or down in the browswer.
 
Feherke,

Thanks for your help. I have already applied alot of CSS i have found.

Can you do 100% height and with with a CSS design.

I need the right side to be 300px and the left to fill the rest? Have you seen any examples like this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top