473,789 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

text-align: right in Firefox

Hi!

When I put a table into a table and try to align it right, it works in IE
but not in Firefox.

Simplest code to reproduce:
<html>
<body>
<table style="width: 100%">
<tr>
<td style="width: 50%">
blabla
</td>
<td style="width: 50%; text-align:right;">
<table>
<tr><td>test</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

How do I align it right "rightly". ;)

Regards, André

Jul 21 '05 #1
8 20033
Els
André Hänsel wrote:
Hi!

When I put a table into a table and try to align it right,
it works in IE but not in Firefox.

Simplest code to reproduce:
<html>
<body>
<table style="width: 100%">
<tr>
<td style="width: 50%">
blabla
</td>
<td style="width: 50%; text-align:right;">
<table>
<tr><td>test</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

How do I align it right "rightly". ;)


table td table{float:rig ht;}

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 21 '05 #2
"André Hänsel" <an***@webkr.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.
<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.
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/
Jul 21 '05 #3
Jukka K. Korpela wrote:
"André Hänsel" <an***@webkr.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.
:)
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. ;)
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?

Jul 21 '05 #4
Jukka K. Korpela wrote:
"André Hänsel" <an***@webkr.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.
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.

Jul 21 '05 #5
Harlan Messinger wrote:
Jukka K. Korpela wrote:
"André Hänsel" <an***@webkr.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? ;)

Jul 21 '05 #6
André Hänsel wrote:
Harlan Messinger wrote:
Jukka K. Korpela wrote:
"André Hänsel" <an***@webkr.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
appropriat e 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>
Jul 21 '05 #7
Harlan Messinger wrote:
André Hänsel wrote:
Harlan Messinger wrote:
Jukka K. Korpela wrote:
"André Hänsel" <an***@webkr.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.

Jul 21 '05 #8
jtwebman
1 New Member
You can also just set style="display: inline;" on the table. This will make the table act like text instead of its own block. That way if you want to center it later you can.

JT

:cool:

Hi!

When I put a table into a table and try to align it right, it works in IE
but not in Firefox.

Simplest code to reproduce:
<html>
<body>
<table style="width: 100%">
<tr>
<td style="width: 50%">
blabla
</td>
<td style="width: 50%; text-align:right;">
<table>
<tr><td>test</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

How do I align it right "rightly". ;)

Regards, André
Jul 1 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4169
by: joes | last post by:
Hello there ! I rendering a PDF with XSLT using Xalan and FOP. I like to place in my article an image, so that the text is floating around the image. I tried several things but it didn't work so far. I found some hints that it should work with "fo:float" but it seems not to work with apache's FOP, so has anybody out there any solution and experience ? example:
2
7586
by: Macsicarr | last post by:
Hi All Wonder if you could help me. I have created a CMS system that allows the user to enter text and pic 'tags' for their own About us page, eg text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text....
2
2294
by: Jiri Palecek | last post by:
I have a question on web authoring (probably HTML+CSS). Is it somehow possible to put two words above each other inside a paragraph so the result would be valid and render at least in Mozilla? I mean this: text text text text text text text text text text text text text text text text text text text text text text text text | is | text text text txt | | text text text text ...
0
1394
by: TadPole | last post by:
I am using FOP to create PDF documents. I have the problem where I need to create line of text on a document in a certain line (absolute position), then the rest of the text needs to follow after that fixed line of text. What I am getting is the fixed line of text starting at the correct place, but then the rest of the text is then starting at the top of the document.
4
2632
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
14
2369
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I read an xml file and, using the values retrieved from it, determine what text should be displayed and which controls should be rendered and - most importantly - where those controls should be rendered. The ultimate goal is to have some text...
3
2612
by: jweinberg1975 | last post by:
I would like for users to be able to select from a small number of options that come from a little drop down menu which then closes. .. http://www.geocities.com/jweinberg1975/dropdown_on_text00.html .. In order to see the behavior you should "mouseover" the white-on-black text segment that says "omnis dolor repellend" .. the thing is that I don't want for the whole space in the paragraph to be empty. I just need for the little menu to...
3
2178
by: bbepristis | last post by:
Hey all I have this code that reads from one text file writes to another unless im on a certian line then it writes the new data however it only seems to do about 40 lines then quits and I cant figure out why any help would be much apprechiated 1. Dim line_num As Integer 2. Dim filename2 As String 3.
3
2665
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file. There are 5 colums of data I wish to display. I want to display these records in groups of 10. Based on the fact that the records I want are located in a separate file, how can I get these details to show on the form and manipulate the data to...
10
3222
by: bluemountain | last post by:
Hi there, Iam new to python forms and programming too I had a text file where i need to extract few words of data from the header(which is of 3 lines) and search for the keyword TEXT1, TEXT2, TEXT3in entire file(file consisting of 150 lines) that is related to a particular id and get the sum of the, WRITES of TEXT1, TEXT2, TEXT3 ex: input file will be as below Windows 2000 text text text text text text text
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.