我一直在使用jQuery Mobiles新的响应表。我有三张桌子,其中两张工作得很好,但由于某种原因,最后一张拒绝工作。
这是代码:
<table data-role='table' id='TableProfile' class='ui-responsive table-stroke'>
<thead>
<tr>
<th data-priority='persist'>#</th>
<th data-priority='persist'>Title</th>
<th>Author</th>
<th>Publisher</th>
<th>Edition</th>
<th data-priority='3'>Condition</th>
<th data-priority='2'>Price</th>
<th>Sold</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Thomas Calculus Early Transcendentals</td>
<td>MD.Weir, GB.Thomas Jr, J. Hass, FR.Giordano</td>
<td>Brooks/Cole</td>
<td>12</td>
<td>5</td>
<td>750</td>
<td><input type='button' value='Sold' name=70/></td>
</tr>
<tr>
<td>2</td>
<td>Thomas Calculus Early Transcendentals</td>
<td>MD.Weir, GB.Thomas Jr, J. Hass, FR.Giordano</td>
<td>Brooks/Cole</td>
<td>10</td>
<td>4</td>
<td>1000</td>
<td><input type='button' value='Sold' name=73/></td>
</tr>
</tbody>
</table>
我使用的是jQuery Mobile 1.3版,但我不知道为什么这个表不能正常工作
我确信有些地方有一个bug,因为这个功能是新的。现在,解决我问题的方法是完全关闭我正在使用的选项卡,然后再次打开网站,结果成功了。刷新页面不会解决问题。
您确定使用的是jQuery>1.7吗?jQuerymobile需要jQuery 1.7或更高版本才能运行。
我试过了,似乎有效。
标准的方法是:
<table data-role="table" id="my-table" data-mode="reflow">
<thead>
<tr>
<th>Rank</th>
<th>Movie Title</th>
<th>Year</th>
<th><abbr title="Rotten Tomato Rating">Rating</abbr></th>
<th>Reviews</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td><a href="foo.com" data-rel="external">Citizen Kane</a></td>
<td>1941</td>
<td>100%</td>
<td>74</td>
</tr>
</tbody>
</table>
代码的工作示例:http://jsfiddle.net/AYSJZ