To create datatable show and hide the columns using js

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

<div>
<strong>Checked the Checkbox for Hide column</strong><br>
<input type="checkbox" class="hidecol" value="name" id="col_2" />&nbsp;Name&nbsp;
<input type="checkbox" class="hidecol" value="opstkamount" id="col_3" />&nbsp;Op stk Amount
<input type="checkbox" class="hidecol" value="rate" id="col_4" />&nbsp;Rate
<input type="checkbox" class="hidecol" value="rateper" id="col_5" />&nbsp;Rate Per
<input type="checkbox" class="hidecol" value="unit" id="col_6" />&nbsp;Unit
<input type="checkbox" class="hidecol" value="unit" id="col_7" />&nbsp;Alert
</div>




class="table table-hover" style="width:100%" id="emp_table">

colspan="2">Product List</td><td colspan="2"><select name="price"><option>Price List1</option><option>Price List2</option><option>Price List3</option><option>Price List4</option></select></td>
colspan="2"><img src="assets/images/print.png" width="30px" height="30px"></td>




stk Amount</th>
Rate</th>
Per</th>






1/2" LAKSHMI CRACKERS</td>









LAKSHMI CRACKERS</td>









LAKSHMI CRACKERS</td>









CRACKERS</td>














</div>

</div>


</div>
<!-- Page body end -->
</div>
</div>
<!-- Main-body end -->
<div id="styleSelector">

</div>
</div>
</div>
</div>
</div>
</div>
</div>


<!-- Warning Section Starts -->
<!-- Older IE warning message -->
<!--[if lt IE 10]>
<div class="ie-warning">
<h1>Warning!!</h1>
<p>You are using an outdated version of Internet Explorer, please upgrade <br/>to any of the following web browsers
to access this website.</p>
<div class="iew-container">
<ul class="iew-download">
<li>
<img alt="Chrome">
<div>Chrome</div>
</a>
</li>
<li>
<img alt="Firefox">
<div>Firefox</div>
</a>
</li>
<li>
<img alt="Opera">
<div>Opera</div>
</a>
</li>
<li>
<img alt="Safari">
<div>Safari</div>
</a>
</li>
<li>
<img alt="">
<div>IE (9 & above)</div>
</a>
</li>
</ul>
</div>
<p>Sorry for the inconvenience!</p>
</div>
<![endif]-->
<!-- Warning Section Ends -->
<!-- Required Jquery -->

<script
<script type="text/javascript"
<script type="text/javascript" "></script>
<script type="text/javascript"
<script type="text/javascript" "></script>
<!-- jquery slimscroll js -->
<script type="text/javascript" "></script>
<!-- waves js -->
<script

<!-- modernizr js -->
<script type="text/javascript"
<script "></script>
<!-- Custom js -->
<script
<script "></script>
<script
<script type="text/javascript"


<script>





var id = this.id;
var splitid = id.split("_");
var colno = splitid[1];
var checked = true;

// Checking Checkbox state
if($(this).is(":checked")){
checked = true;
}else{
checked = false;
}
setTimeout(function(){
if(checked){
$('#emp_table
$('#emp_table
} else{
$('#emp_table
$('#emp_table
}

}, 1500);

});
});

</script>
</body>

</html>

thangamcoding