Specifying height of a table row?

liunx

Guest
Is there a limit to how small you can make the height of a table row?<br />
<br />
I want to use small GIF's in a table, to make writing appear in a nice rounded background box. To do this, I am using the GIF's in the top and sides as background images - that means they can re-scale automatically to the size of the table, and the effect will be preserved whatever someone's text settings etc..<br />
<br />
BUT - although I specify the hieght of the row, it doesn't have any effect. The row is still default size, and the image therefore tiles vertically.<br />
<br />
Box in table (<!-- m --><a class="postlink" href="http://www.netcartoon.net/box.html">http://www.netcartoon.net/box.html</a><!-- m -->) <br />
<br />
I have specified the height in all the cells on the bottom row, and there is no text in them. I have even tried settingthe font size to the smallest possible anyway, just in case that helps. But it stays the default size.<br />
<br />
I am sure this can be done, cos websites like Amazon use have things like this. I really want to stick with the top, side and bottom images being cell backgrounds because it means the table can still be relatively scaled.<br />
<br />
Anyone know why this happens?<br />
<br />
Thanks<!--content-->This cell:<br />
<td background="images/boxo_12.gif" height="13" valign="top">&nbsp;</td>sets the height to the default text size and conflicts with the specified cell height. Therefore, the browser ignores the requested height in favor of the text height.<!--content-->You could use CSS to set a new font-size so the cell will be the size you specified like this:<br />
<br />
<td background="images/boxo_12.gif" height="13" valign="top" style="font-size:1px;">&nbsp;</td><!--content-->Thanks gil / pyro. Sorry to be stupid, but where in that tag is it specifying default text size? Or do you just mean because it DOESN'T specify a text size, the browser assumes it?<br />
<br />
In theory, couldn't I just specify the text size instead of using CSS? I will try both anyway.<br />
<br />
Thanks as ever for the help.<br />
<br />
<br />
PS. Otherwise, is this an ok thing to do? I know people get funny about background images, but it seems a logical way to create the effect. Will there be any risks?<!--content-->Originally posted by tobyw_1969 <br />
do you just mean because it DOESN'T specify a text size, the browser assumes it?Yes.<br />
In theory, couldn't I just specify the text size instead of using CSS?Yes.<br />
is this an ok thing to do?If you had used a plain image instead of using the bgImage property of a table, you would not have had to ask for help with the cell height, because the &nbsp; would not have been necessary. To each his own. I do not try to judge, only help when problems arise.<!--content-->yes I know - but the whole point of using the bg-image is so you can use a tiny GIF and stretch it automatically to the size of the table - even when someone has a larger text size. is there a way to make a plaing <img> tag automatically stretch?<!--content-->This works in IE:<tr height=13><br />
<td><img src=http://www.webdeveloper.com/forum/archive/index.php/"whatever" height="100%" width="100%"></td><br />
</tr>I should point out that there is an ongoing arguement against "misusing" the table element for page layout, and that this trick does not work in NS 4 or NS 6.<!--content-->Thanks a lot gil. Clear and useful replies :)<br />
<br />
I think I will stick to the background thing, because at least it seems to work in NS.<!--content-->
 
Back
Top