哪些 DOM 元素可以是 tr 的子元素? [英] Which DOM elements can be child of tr?
本文介绍了哪些 DOM 元素可以是 tr 的子元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题,因为我想在 tr
中包含一些 td
所以我需要知道.
I have problem becouse I want to surround some of td
inside tr
so I need to know.
哪些 DOM 元素可以是 tr 的子元素?(我知道 div
不能.)
Which DOM elements can be child of tr? (I know div
cannot.)
推荐答案
W3C 指定了这些东西.对于tr
,您可以在这里找到.基本上,只有 th
和 td
元素可以成为 tr
的直接内容.
W3C specify this stuff. For tr
, you can find it here. Basically, only th
and td
elements can be direct contents of tr
.
如果你想把其他东西放在你的表里,它必须在td
或th
元素.例如td
可以包含流元素,包括div
.
If you want other stuff inside your table, it has to go inside the td
or th
elements. For example, td
can contain flow elements, including div
.
这篇关于哪些 DOM 元素可以是 tr 的子元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文