放在页面示例(和简单)表上:
<table id="myTable">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Column 1</td>
<td>Row 1 Column 2</td>
<td>Row 1 Column 3</td>
</tr>
<tr>
<td>Row 2 Column 1</td>
<td>Row 2 Column 2</td>
<td>Row 2 Column 3</td>
</tr>
</tbody>
</table>
显示不出意外 - 标题是一行,内部是 trs - 行。看这个:
Column 1 Column 2 Column 3
Row 1 Column 1 Row 1 Column 2 Row 1 Column 3
Row 2 Column 1 Row 2 Column 2 Row 2 Column 3
然后尝试制作 jQuery 样式的表格 - 只需将 data-role="table" 添加到表格标签。惊喜 - 转置的表:1)头部是列(!)2)行是列。看这个:
Column 1Row 1 Column 1
Column 2Row 1 Column 2
Column 3Row 1 Column 3
Column 1Row 2 Column 1
Column 2Row 2 Column 2
Column 3Row 2 Column 3
这是默认行为吗?这是怎么回事?如何强制jQuery表正常?