Как Показать/Скрыть столбцы в таблице.?
I have tried below the table design, but I m not able to success.
плз помогите..спасибо
Что я уже пробовал:
<p> <input type="checkbox" name="ProjectGroupName" checked="checked"> ProjectGroupName <input type="checkbox" name="ProjectName">ProjectName <input type="checkbox" name="BugID" checked="checked"> BugID </p> <table class="table table-striped table-bordered table-hover" cellspacing="0" rules="all" border="1" id="ctl00_ContentPlaceHolder1_GridViewUserControlnew_grdUserControl" style="border-collapse:collapse;"> <tr> <th name="ProjectGroupName" scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridViewUserControlnew$grdUserControl','Sort$ProjectGroupName')">ProjectGroupName</a></th> <th name="ProjectName" scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridViewUserControlnew$grdUserControl','Sort$ProjectName')">ProjectName</a></th> <th name="BugID" scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridViewUserControlnew$grdUserControl','Sort$BugID')">BugID</a></th> </tr> <tr> <td name="ProjectGroupName">Test Group</td> <td name="ProjectName">7.3</td> <td name="BugID">36244</td> </tr> <tr> <td name="ProjectGroupName">Test Group 2</td> <td name="ProjectName">Interface 1.1</td> <td name="BugID">3212</td> </tr> <tr> <td name="ProjectGroupName">Team Management</td> <td name="ProjectName">RR CE</td> <td name="BugID">3232</td> </tr> <tr> <td name="ProjectGroupName">Test Group 3</td> <td name="ProjectName">Testing Project</td> <td name="BugID">1</td> </tr> </table> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $("input:checkbox:not(:checked)").each(function () { var column = "table ." + $(this).attr("name"); $(column).hide(); }); $("input:checkbox").click(function () { var column = "table ." + $(this).attr("name"); $(column).toggle(); }); </script>
ZurdoDev
В чем же проблема?
venkatesh (chennai)
Я пытаюсь показать/скрыть столбцы, установив флажок...
но я не могу этого сделать...это моя проблема..