h:dataTable bodyrows 属性是什么意思
What does h:dataTable bodyrows attribute mean
有人知道h:dataTable bodyrows
是什么意思吗?我尝试了一个简单的例子,但我不明白它应该做什么。
<h:dataTable bodyrows="d" value="#{index.publishDates}" var="d">
这是制作 table 的某种捷径吗?由于 bodyrows
注释,我没有看到任何行。如果 h:column
做列,那么 bodyrows
做什么?
我不明白the documentation。
This must be a comma separated list of integers. Each entry in this list is the row index of the row before which a "tbody" element should be rendered.
在HTML中,一个<table>
可以通过<tbody>
有多个主体。
<table>
<tbody>...</tbody>
<tbody>...</tbody>
<tbody>...</tbody>
</table>
默认情况下,一个 <h:datatable>
只生成一个正文,如下所示。
<h:dataTable value="#{[1,2,3,4,5]}" var="i">
<h:column>#{i}</h:column>
</h:dataTable>
<table>
<tbody>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
<tr><td>5</td></tr>
</tbody>
</table>
bodyrows
属性可用于指定以逗号分隔的行索引字符串,该行索引应作为新主体开始。
<h:dataTable value="#{[1,2,3,4,5]}" var="i" bodyrows="0,2,4">
<h:column>#{i}</h:column>
</h:dataTable>
<table>
<tbody>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
</tbody>
<tbody>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</tbody>
<tbody>
<tr><td>5</td></tr>
</tbody>
</table>
另请参阅:
- Can we have multiple <tbody> in same <table>?
- HTML Dog HTML beginner tutorial - tables
- MDN HTML element reference - table
有人知道h:dataTable bodyrows
是什么意思吗?我尝试了一个简单的例子,但我不明白它应该做什么。
<h:dataTable bodyrows="d" value="#{index.publishDates}" var="d">
这是制作 table 的某种捷径吗?由于 bodyrows
注释,我没有看到任何行。如果 h:column
做列,那么 bodyrows
做什么?
我不明白the documentation。
This must be a comma separated list of integers. Each entry in this list is the row index of the row before which a "tbody" element should be rendered.
在HTML中,一个<table>
可以通过<tbody>
有多个主体。
<table>
<tbody>...</tbody>
<tbody>...</tbody>
<tbody>...</tbody>
</table>
默认情况下,一个 <h:datatable>
只生成一个正文,如下所示。
<h:dataTable value="#{[1,2,3,4,5]}" var="i">
<h:column>#{i}</h:column>
</h:dataTable>
<table>
<tbody>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
<tr><td>5</td></tr>
</tbody>
</table>
bodyrows
属性可用于指定以逗号分隔的行索引字符串,该行索引应作为新主体开始。
<h:dataTable value="#{[1,2,3,4,5]}" var="i" bodyrows="0,2,4">
<h:column>#{i}</h:column>
</h:dataTable>
<table>
<tbody>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
</tbody>
<tbody>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</tbody>
<tbody>
<tr><td>5</td></tr>
</tbody>
</table>
另请参阅:
- Can we have multiple <tbody> in same <table>?
- HTML Dog HTML beginner tutorial - tables
- MDN HTML element reference - table