使用this script时出现问题没有使用 rowspan 的标准表。
在调整大小时查看第二个表。
<table class="table2 responsive">
<tbody>
<tr>
<th rowspan="2">name</th>
<th colspan="3">1</th>
<th rowspan="2">5</th>
<th colspan="2">6</th>
<th rowspan="2">9</th>
<th rowspan="2">10</th>
<th rowspan="2">11</th>
<th rowspan="2">12</th>
<th rowspan="2">13</th>
<th rowspan="2">14</th>
</tr>
<tr>
<th>2</th>
<th>3</th>
<th>4</th>
<th>7</th>
<th>8</th>
</tr>
<tr>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
<td>test</td>
</tr>
</tbody>
</table>
如果有任何帮助,我将不胜感激。谢谢。
最佳答案
copy.find("td:not(:first-child), th:not(:first-child)").css("display", "none");
它会跳过单元格,所以它不会隐藏,隐藏的也不会显示。
对于测试,您可以手动添加 display:none
并删除 display:none
它应该可以正常工作。
关于javascript - 使用 rowspan 调整表的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30013250/