【发布时间】:2012-12-09 03:34:57
【问题描述】:
align 似乎不适用于 th 元素。这是我的 HTML:
<div style="width: 100%; height: 175px; overflow: auto;">
<table class="grid" id="table">
<thead>
<tr>
<th class="not_mapped_style" style="display: none;" align="center">id</th>
<th class="not_mapped_style" align="center">DisplayName</th>
<th align="center">PrimaryEmail</th>
<th align="center">Age</th>
<th align="center">Phone</th>
</tr>
</thead>
<caption>Contacts</caption>
<tbody>
<tr>
<td style="display: none;" property_value="0" property_name="id" align="center">0</td>
<td property_value="rpcuser" property_name="DisplayName" align="center">rpcuser</td>
<td property_value="admin@domain.com" property_name="PrimaryEmail" align="center">admin@domain.com</td>
<td property_value="69" property_name="Age" align="center">69</td>
<td property_value="+722616807" property_name="Hand_Phone" align="center">+18007</td>
</tr>
</tbody>
</table>
</div>
文本对齐对于td 元素工作得很好,但对于th 则失败。为什么?
【问题讨论】:
-
我认为它在 Firefox、IE 8 或 Chrome 中没有问题。确保您可能使用的任何 css 都不会超过您的标签属性。即使是内联样式属性也会比 HTML 属性具有更高的优先级。
标签: html html-table