HighDots Forums  

Re: text-align: right in Firefox

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: text-align: right in Firefox in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: text-align: right in Firefox - 01-18-2005 , 02:40 AM






"André Hänsel" <andre (AT) webkr (DOT) de> wrote:

Quote:
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.

Quote:
td style="width: 50%; text-align:right;"
table
tr><td>test</td></tr
/table
/td
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.

Quote:
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.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #2  
Old   
André Hänsel
 
Posts: n/a

Default Re: text-align: right in Firefox - 01-18-2005 , 03:49 AM






Jukka K. Korpela wrote:
Quote:
"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.
Yes, of course me and IE were wrong, that's why I asked how to do it right.


Quote:
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.
By the way, so I got a nice description of my problem.

Quote:
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.
Yes, I'm using a table for layout... still an old vice. It's just one for
the overall layout of the page, but...

....probably I can also avoid even that.
I have one logo in the upper left corner, a box with a login form in the
upper right corner, the content in the middle and a footer line at the
bottom.
How does a correct CSS for that look like? Link?



Reply With Quote
  #3  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: text-align: right in Firefox - 01-18-2005 , 09:12 AM



Jukka K. Korpela wrote:
Quote:
"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]

Quote:
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.

Quote:
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.


Reply With Quote
  #4  
Old   
André Hänsel
 
Posts: n/a

Default Re: text-align: right in Firefox - 01-18-2005 , 10:30 AM



Harlan Messinger wrote:
Quote:
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?



Reply With Quote
  #5  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: text-align: right in Firefox - 01-18-2005 , 01:36 PM



André Hänsel wrote:
Quote:
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?
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?

<table>
<tr><td>test</td></tr>
</table>


Reply With Quote
  #6  
Old   
André Hänsel
 
Posts: n/a

Default Re: text-align: right in Firefox - 01-19-2005 , 06:34 PM



Harlan Messinger wrote:
Quote:
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?
Well, I could not imagine that it has any influence on the alignment of _the
table itself_, what is _in_ the table, so I used a table with only one cell.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.