Sunday, January 24, 2010

How do you control the height of a table?

For those who tried to adjust the definite height of a table know that it is hard to control the height of a table that looks similar in all the browsers.

Here are the codes that I used to make sure the height is showed as defined:

<table cellpadding=0 cellspacing=0 border=0>
<tr><td height=13><img src="img/dummy.gif" height=13 width=1></td></tr>

You also need to prepare a dummy gif file to make this happen. The dummy gif file is better to be transparent in case you have background image from the upper tables and you don't this dummy gif to block it. The width is optional if your gif file has the smallest size of 1x1.

For a height of 13, it is not achievable by just specifying it in the <TD>. This is the only way I can think of and it comes in handy when you want to make your web design go according as planned in your photoshop design.

No comments:

Post a Comment