![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
When I put a table into a table and try to align it right, it works in IE but not in Firefox. |
|
td style="width: 50%; text-align:right;" table tr><td>test</td></tr /table /td |
How do I align it right "rightly". ![]() |
#2
| |||
| |||
|
|
"André Hänsel" <andre (AT) webkr (DOT) de> wrote: When I put a table into a table and try to align it right, it works in IE but not in Firefox. Usually when people describe a problem that way, it's in reality Firefox that gets things right and IE wrong. |

|
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. The text-align property is inherited into the inner td so the line ultimately gets aligned to the right, but only within its container, the cell, and the width of the container is here just as much as needed for it. IE, as so often, gets this wrong. |

How do I align it right "rightly". ![]() Using float: right as suggested by Els would be the technically appropriate way, but what are you really trying to accomplish? It seems that you are using tables for layout - nested tables are _mostly_ an indication of that. Then you might just as well use table align="right"> for the inner table. Alternatively, you could try and implement the layout in CSS instead of a mixed approach. |
#3
| |||
| |||
|
|
"André Hänsel" <andre (AT) webkr (DOT) de> wrote: When I put a table into a table and try to align it right, it works in IE but not in Firefox. |
|
Using float: right as suggested by Els would be the technically appropriate way, but what are you really trying to accomplish? It seems that you are using tables for layout - nested tables are _mostly_ an indication of that. |
|
Then you might just as well use <table align="right"> for the inner table. Alternatively, you could try and implement the layout in CSS instead of a mixed approach. |
#4
| |||
| |||
|
|
Jukka K. Korpela wrote: "André Hänsel" <andre (AT) webkr (DOT) de> wrote: When I put a table into a table and try to align it right, it works in IE but not in Firefox. [snip] Using float: right as suggested by Els would be the technically appropriate way, but what are you really trying to accomplish? It seems that you are using tables for layout - nested tables are _mostly_ an indication of that. As is using a table with one row and one column--that seems rather odd. |

#5
| |||
| |||
|
|
Harlan Messinger wrote: Jukka K. Korpela wrote: "André Hänsel" <andre (AT) webkr (DOT) de> wrote: When I put a table into a table and try to align it right, it works in IE but not in Firefox. [snip] Using float: right as suggested by Els would be the technically appropriate way, but what are you really trying to accomplish? It seems that you are using tables for layout - nested tables are _mostly_ an indication of that. As is using a table with one row and one column--that seems rather odd. What d'ya mean? ![]() |
#6
| |||
| |||
|
|
André Hänsel wrote: Harlan Messinger wrote: Jukka K. Korpela wrote: "André Hänsel" <andre (AT) webkr (DOT) de> wrote: Using float: right as suggested by Els would be the technically appropriate way, but what are you really trying to accomplish? It seems that you are using tables for layout - nested tables are _mostly_ an indication of that. As is using a table with one row and one column--that seems rather odd. What d'ya mean? ![]() A table is a two-dimensional matrix of rows and columns (or even more dimensions represented by a hierarchy of row and column headers and subheaders). What do you think it means to have a table with one only cell in it, as you do in your code? |
![]() |
| Thread Tools | |
| Display Modes | |
| |