This html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>TD align test</title></head>
<body>
<table width="100%">
<tr><td>aligned left</td><td align="right">aligned right</td></tr>
<tr><td colspan="2" align="center">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td>should be aligned left</td></tr>
</table>
</td></tr>
</table>
</body>
</html>
aligns the “should be aligned left” centered in IE (6 & 8) and Opera, but to the left in Firefox (3.6 & 4 beta) and Chromium. The former seem to propagate the alignment from the td to the contained table.
Can anyone explain this difference? And which behavior is more standards-compliant?
(You can try it at http://ysth.info/tdalign.html.)
You can have a look at http://www.docsteve.com/DocSteve/TechNotes/IE6_cascade_test.html for why it might be happening.
The fact is that it is another IE glitch (incompatibility with other browsers) . Only thing i can suggest is to override it, by explicitly specifying the alignment you want..
If you use classes and the
text-align:centeryou will notice that all browsers behave as IE does with thealignattribute, so not sure which is correct/wrong with that.