Question
Why do th
elements have centered text when text-align: center;
is not specified by browser default?
System setup
- MacBook Pro, mid-2014
- OS X v 10.10.2
- Google Chrome v 40.0.2214.94 (64-bit)
- all software up-to-date as of time of this posting
Example Code
<!-- no external or internal CSS applied.
browser default styles only. -->
<table width="500" border="1"> <!-- attributes for debugging only. never use these attributes in real code (use CSS instead). -->
<tr><th> table heading </th><th> centered text </th></tr>
<tr><td> table data </td><td> left-aligned text </td></tr>
</table>
Screen Shots
HTML rendering:
Dev Tools on first th
element:
Nowhere here do I see text-align: center;
, yet clearly the text in th
is center-aligned. Is this a Chrome bug?
Related Question
Update
As of Chrome v67, th
now has a specified text-align: -internal-center;
by browser default.