html - 元素符号列表和 HTML 表格

标签 html css

我在 HTML 表格中显示元素符号列表,如下所示。

<ul style="list-style-type: decimal;">
    <table>
        <tbody>
            <tr><td><li>Description</li></td></tr>
            <tr><td><li>Description</li></td></tr>
            <tr><td><li>Description</li></td></tr>
            <tr><td><li>Description</li></td></tr>
            <tr><td><li>Description</li></td></tr>
        </tbody>
    </table>
</ul>

JSFiddle

然而,这不会在不同的浏览器上正确显示元素符号列表。

在 Google Chrome (36.0.1985.143 m) 上,它按预期显示。

enter image description here

然而,在 FireFox (31.0) 上,它显示如下列表。

enter image description here

在 Internet Explorer (8) 上,列表显示如下。

enter image description here

<ul> 中嵌套表格是否为无效标记? ?能否如第一个快照所示在所有主要浏览器上显示此列表?

最佳答案

list-style-type 仅适用于 display:list-item

list-style-type: Applies to: elements with 'display: list-item'

引用

list-style-type

The ul element

ul element: Content model: Zero or more li and script-supporting elements.

fiddle

关于html - 元素符号列表和 HTML 表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25629151/

相关文章:

java - 在 html 样式的 jTextPane 中插入 java 变量

jquery - 如何处理嵌套列表的内部 LI 单击

html - Divs 图片,UL

css - 将 Bootstrap 下拉菜单移动到另一侧

css - Div/class 不会水平对齐

javascript - 如何以编程方式关闭选择文件对话框

Javascript/HTML5 使用图像填充 Canvas

html - 小窗口上的未知透明覆盖

html - CSS 中的双边框

css - 单击时导航栏修改下拉菜单项上的边框/背景颜色