哪些DOM元素可以是tr的孩子? [英] Which DOM elements can be child of tr?

查看:83
本文介绍了哪些DOM元素可以是tr的孩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题,因为我想围绕 tr 中的一些 td ,所以我需要知道。 p>

哪些DOM元素可以是tr的孩子? (我知道 div 不能。)

解决方案

W3C指定这些东西。对于 tr ,您可以找到此处。基本上,只有 th td 元素可以直接 tr 。



如果你想要表格中的其他东西,它必须在元素的 td th 例如, td link here )可以包含流量元素,包括 div link here )。


I have problem becouse I want to surround some of td inside tr so I need to know.

Which DOM elements can be child of tr? (I know div cannot.)

解决方案

W3C specify this stuff. For tr, you can find it here. Basically, only th and td elements can be direct contents of tr.

If you want other stuff inside your table, it has to go inside the td or th elements. For example, td (link here) can contain flow elements, including div (link here).

这篇关于哪些DOM元素可以是tr的孩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆