我想顯示3個複選框被預籤,但只要用戶取消選中一個框,列相關消失。隱藏表列自動勾選複選框使用jQuery
<p><input type="checkbox" name="first_name" checked> First Name</p>
<p><input type="checkbox" name="last_name" checked> Last Name</p>
<p><input type="checkbox" name="email" checked> Email</p>
渲染表
<table id="report>
<thead>
<tr>
<th class="first_name">First Name</th>
<th class="last_name">Last Name</th>
<th class="email">Email</th>
</tr>
</thead>
<tbody>
<tr>
<td class="first_name">Larry</td>
<td class="last_name">Hughes</td>
<td class="email">[email protected]</td>
</tr>
<tr>
<td class="first_name">Mike</td>
<td class="last_name">Tyson</td>
<td class="email">[email protected]</td>
</tr>
</tbody>
</table>
我想它會與現場click事件做的HTML,設置每個班.hide()
任何幫助表示讚賞
請參閱http://stackoverflow.com/questions/12455699/show-hide-table-column-with-colspan-using-jquery回答colspan – Lijo 2012-09-19 05:15:32