< DIV>到< tr>:是否正确? [英] <div> into a <tr>: is it correct?

查看:84
本文介绍了< DIV>到< tr>:是否正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这段代码是否正确?

Is this code correct?

<table>
    <tr>
        <td>...</td>
    </tr>

    <tr>
        <div>...</div>
    </tr>

    <tr>
        <td>...</td>
    </tr>    
</table>    

不知道语义(和W3C规则)。你能说什么?

don't know for semantic (and W3C rules). What can you say about?

推荐答案

不,它是无效的。 tr 元素只能包含 th td 元素。从 HTML4规范

No it is not valid. tr elements can only contain th and td elements. From the HTML4 specification:


<!ELEMENT TR       - O (TH|TD)+        -- table row -->
<!ATTLIST TR                           -- table row --
  %attrs;                              -- %coreattrs, %i18n, %events --
  %cellhalign;                         -- horizontal alignment in cells --
  %cellvalign;                         -- vertical alignment in cells --
>


这篇关于&LT; DIV&GT;到&lt; tr&gt;:是否正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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