CSS - 使用自定义HTML标记显示表格单元格无法正确呈现

时间:2013-11-25 21:22:05

标签: css

我已将<td>替换为<custom-tag>,然后在我的CSS中custom-tag { display: table-cell; },但Chrome和Firefox似乎都从表中删除了该元素。 显示有什么好处:如果不是这样的表格单元格

<table>
  <tr>
    <span style="display:table-cell"></span>
    <span style="display:table-cell"></span>
    <span style="display:table-cell"></span>
  </tr>
</table>

不使用<td>的原因是我想实现一个Can.js组件。但这不是重点。

http://jsfiddle.net/zNj5C/

1 个答案:

答案 0 :(得分:2)

也许相反:

<div style="display: table;">
    <div style="display: table-row;">
        <span style="display:table-cell"></span>
        <span style="display:table-cell"></span>
        <span style="display:table-cell"></span>
    </div>
</div>