多个< thead> /< tbody>在表中有效? [英] Multiple <thead>/ <tbody> in Table Valid?

查看:107
本文介绍了多个< thead> /< tbody>在表中有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设列表类似于这个列表:

  var list = [
{name:'group1' ,
物品:[1,2,3,4,5]
},
{名称:'group2',
物品:[1,2,3,4, 5]
},
等...
]

现在忘记了整个表是用于数据而非设计的说法,我想为 list 显示一个表,并且单独显示< thead> < tbody> 用于 list 中的每个条目。



这在技术上有效吗?这可以在浏览器中使用,但是我的蜘蛛感觉在刺激这个

解决方案

您可以拥有任意数量的< tbody> < thead> < tfoot> 中的每一个。 参考资料


内容模型

按此顺序:
由零个或多个colgroup元素组成,随后可以选择一个thead
元素,后跟零个或多个tbody元素或一个或多个
tr元素,随后可选择一个tfoot元素
,可选
与一个或多个支持脚本的元素混合。



Imagine a list of lists similar to this:

var list = [
  { name: 'group1', 
    items: [ 1, 2, 3, 4, 5 ]
  },
  { name: 'group2', 
    items: [ 1, 2, 3, 4, 5 ]
  },
  etc...
]

Now forgetting the whole "tables are for data not design" argument, I wanted to display a single table for list and have a seperate <thead> and <tbody> for each entry in list.

Is this technically valid? This works in the browser, but my spider senses are tingling on this one.

解决方案

You can have as many <tbody> elements as you want, but no more than one each of <thead> and <tfoot>. Reference:

Content model:

In this order: optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, followed by either zero or more tbody elements or one or more tr elements, followed optionally by a tfoot element, optionally intermixed with one or more script-supporting elements.

这篇关于多个&lt; thead&gt; /&lt; tbody&gt;在表中有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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