Forum Bugs

align="center" inheritance

bluej100
align="center" appears to be inherited as a text-align: center, rather than margin: auto. For example, a <table align="center"> will be centered on the page, but a <table> in a <div align="center"> will just have centered text.

Examples:



live example

I know this is rather esoteric, but when Firefox, IE6, IE8, Chrome, and Opera agree on a behavior and you disagree, I think it should be considered a bug.
mikeday
Unfortunately the complete behaviour of the HTML align attribute cannot be easily replicated in CSS, although it is possible to come close with rules like this:
div[align="center"] > table { margin-left: auto; margin-right: auto }

In the future we may provide more support for HTML presentational attributes, although it is worth noting that the align attribute on divs has been officially deprecated since HTML 4.0 was released back in 1997! :D
bluej100
Thanks for the workaround. Certainly understandable that it's not a high priority.