Jump to content

Tables


george

Recommended Posts

If I have two data cells of uneven height, the shorter one gets placed in the middle; for example;

<table>	<tr>		<td>S<br />W</td>		<td>T<br />Q<br />Y<br />X<br />T<br />Q<br />Y<br />X</td>	</tr></table>

How can I get the shorter data column to begin with the longer one at the top of the column head? Thanks

Link to comment
Share on other sites

Problem solved. I created a class for the row my uneven columns of data were in, and gave the class these attributes:

tr.box { vertical-align:top; padding-top:0px; margin-top:0px; }

I'm sure some of these attributes were unnecessary. But as long as they are not hurting, I have to move on.

Link to comment
Share on other sites

Problem solved. I created a class for the row my uneven columns of data were in, and gave the class these attributes:
tr.box { vertical-align:top; padding-top:0px; margin-top:0px; }

I'm sure some of these attributes were unnecessary. But as long as they are not hurting, I have to move on.

If you want all cells to start with the data at the top, the more elegant and easily controled method would be to do
table tr { vertical-align:top; }

Instead of placing a specific class to make it appear as you think you do, just make it the default for all table cells on your page and only change the ones that you need to specifically. Always try to use an element selector over a class selector if you can.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...