Another table-in-table dilemma

liunx

Guest
There's a table with many rows and cells. <br />
I would like a red-colored table to fill up 50% of a cell.<br />
<br />
The problem is it only works when I use "height=5" pixels, and I guess what is half. "Height=50%" deflates to a sliver (but a pixel tall?), and does not align properly.<br />
<br />
Attempt #1<br />
<table border="1"><br />
<td><big>Test, push up height of row.</big></td><br />
<td valign="bottom"><br />
<table width="100%" height="50%" valign="bottom" bgcolor="#FF0000"<br />
cellpadding="0" cellspacing="0"><br />
<tr><br />
<td></td><br />
</tr><br />
</table><br />
</td><br />
</table>I know browsers only like to show cells with STUFF in them, so I stuck in a invisible-1-pixel-GIF inside <td></td>. No difference.<!--content-->I think that the biggest problem is that height is not actually an attribute of the table tag. It is only a legal attribute of a cell (TD or TH). And even then, it is deprecated.<br />
<br />
Doog Xela<!--content-->Originally posted by doogxela <br />
I think that the biggest problem is that height is not actually an attribute of the table tag. It is only a legal attribute of a cell (TD or TH). And even then, it is deprecated.<br />
<br />
Doog Xela <br />
that is hog wash. the height works in the Table tag as well as teh cell.<br />
<br />
Posti:<br />
<br />
<br />
<table border="1" width="100%" height="100%"><br />
<td width="50%"><big>Test, push up height of row.</big></td><br />
<td height="100%"><br />
<table border="1" width="50%" height="100%" bgcolor="#FF0000" cellpadding="0" cellspacing="0"><br />
<tr><br />
<td>somehing</td><br />
</tr><br />
</table><br />
</td><br />
</tr><br />
</table><!--content-->Hogwash or not, it is still deprecated.<br />
<br />
height = length [CN] <br />
Deprecated. This attribute supplies user agents with a recommended cell height.<br />
<br />
The height attribute appears only once in the tables chapter (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/struct/tables.html">http://www.w3.org/TR/html401/struct/tables.html</a><!-- m -->) of the HTML 4.01 specification (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/">http://www.w3.org/TR/html401/</a><!-- m -->), and that one spot is in the cell tag.<br />
<br />
I realize that this doesn't solve postitlord's problem, but he is trying to do something that isn't in the specifications.<br />
<br />
Doog Xela<!--content-->I agree it is deprecated but I was saying it will work in the cell as well as teh table. but if we are getting technical the cellpadding and cellspacing isn't valid either.<!--content-->I don't want to seem ungrateful scoutt, but the word "something" is too big. If the cell directly next to it the height of a word, then the red cell should be half-the-height-of-a-word. Putting "something" in would push it up to 100%, like it's neighbour.<br />
<br />
I put in <big> tags to exagerate. But they might hide what I'm describing if the red-cell has words without big.<br />
<br />
Doog Xela, do you have a better suggestion for adjusting the vertical spacing in a cell of a table?<br />
<br />
The effect should like <!-- w --><a class="postlink" href="http://www.geocities.com/postitlord/schedule.html">www.geocities.com/postitlord/schedule.html</a><!-- w -->, but this only works at one exact font size. I want it to work when the Text Size is increased or decreased.<!--content-->well then I am not sure waht you want. you say I would like a red-colored table to fill up 50% of a cell. and that is exactly what it does. even if you take out the word.<br />
<br />
besides how do you go half a word??<!--content-->Can you draw a picture of what you want? That might be better for us to visualize. I guess I'm not really getting what you want to do.<!--content-->Picture requested, picture made:<!--content-->If for some reason your computer doesn't use the default Medium sized Times font in IE, then my HTML file above may not look like 'halves'.<br />
<br />
I have provided a picture Just In Case.<!--content-->all you had to do was change my code a little bit. geez this was easy ;)<br />
<br />
<br />
<table border="1" width="100%"><br />
<td width="50%"><font size=6>Test, push up height of row.</font></td><br />
<td height="50%"><br />
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0"><br />
<tr><br />
<td height="50%">&nbsp;</td><br />
</tr><br />
<tr><br />
<td height="50%" bgcolor="#FF0000">&nbsp;</td><br />
</tr><br />
</table><br />
</td><br />
</tr><br />
</table><!--content-->Rofl! :rofl: of course. I understand that code! Make it simple, by using two rows, each 50%. That works as requested.<br />
<br />
Why didn't I think of that? Must be all that university math cluttering up my head; :bash: matrices and logic pushed out fundamental HTML concepts.<!--content-->
 
Back
Top