PDA

View Full Version : Align property in TD acting funny.



donmateo
Sep 7th, 2007, 08:18 PM
Yo,

First off I know I should be doing this in CSS but I got handed the site after it was built and don't really feel like redesigning it.

Anyway, my site is being laid out in tables. AHHHH.

Description:
I have an outer table with the header in the top row, content in the middle row, and the footer in the bottom row. Table width is set to 100% and td aligns are all set to center. So naturally the site centers in the browser.

Heres my problem:
Within the middle row(site content) there is another table that holds and lays out the content as needed per page.

It is my understanding that when you don't put an align property in a td it should default to left, correct? That being said my content table should not be affected by the align="center" in the td of the outter table. It is though, everything in the content table is being centered. This only happens in IE though. FF is fine.

Any Ideas?

Matt

nikkiH
Sep 7th, 2007, 08:24 PM
"It is my understanding that when you don't put an align property in a td it should default to left, correct?"

I believe it would inherit the center from the container.
Do you have a doctype set with URL? If not, the browser will be in quirks mode.

donmateo
Sep 7th, 2007, 08:51 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">

Thats what I have set as DOCTYPE

nikkiH
Sep 7th, 2007, 11:55 PM
Ok, the cells do inherit, and it doesn't look like nested tables are explicitly defined in the specs.
http://www.w3.org/TR/html4/struct/tables.html#alignment

So, it may be browser specific as to which they default to in a nested situation.
Did you try just setting align=left on the nested table?