Monday, September 29, 2008

Use text-algin:right for table

Try the following code to align inner table (print) to right.


<TABLE width="100%" cellpadding="0" cellspacing="0" border="1">
<TR>
<TD><H1>Header</H1></TD>
<TD style="text-align:right">
<TABLE><TR><TD>Print</TD></TR></TABLE>
</TD>
</TR>
</TABLE>


In IE, that is straight forward -- I got "Print" to the right side. But, not Firefox.
According to http://bytes.com/forum/thread100308.html "The text-align property affects, by CSS specifications, the alignment of text lines inside the element. The inner table is a block element, so it is not affected.", that is make sense to me. However, it just give my style sheet more complication.

No comments: