Hide table column using jquery

I have a table with 5 columns, I want to show column by column, first show the 1st column, after 5 seconds hide this column and show the 2nd. 1 var data = ($(this).parents("tr")).data();. You can access the data even if it's a hidden column. alert("Hidden data - Proveedor. 2 › Guide › DataGrid › Columns. 3 A column is considered hidden when its visible property is false. In In jQuery, you can change this property using the columnOption(id, optionName. 4 One line of code using jQuery which hides the 2nd column: $ ('td:nth-child (2)').hide (); If your table has header (th), use this: $ ('td:nth-child (2),th:nth-child (2)').hide (); Source: Hide a Table Column with a Single line of jQuery code jsFiddle to test the code: 5 You can get the header index of table and make the table header and td elements hidden. Something like this Suppose the index of table header is index = 2; var index= tableHeaderIndex; // 2 here $ ('th:nth-child ('+index+')').hide (); $ ('td:nth-child ('+index+')').hide (); Share Improve this answer Follow answered at PranitG. 6 Live demo by Makitweb - An example, to show how you can hide and show the table column using jQuery. Back to Tutorial Download How to Hide and Show the Table column using jQuery. 7 I have two columns in table. $ ('th:nth-child (2)', #tbl').hide (); $ ('td:nth-child (2)', #tbl').hide (); Hi, i am using above code. Your provided code to hide a column is woring but by right-border also hide. Please help how may i go with my border style same after hiding the column. I mean border style should not be effected on column hiding. 8 JS Options $ ("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 (); });. 9 The simple and nice jQuery based plug-in, hide_columns, can be used for allowing the users to show or hide the HTML table columns in your website. The integration process is quite simple for using this plug-in in any table. dxdatagrid column hiding enabled 10