Alex (SirShurf) Frenkel's Blog

A web log of a PHP professional

Posts Tagged ‘JavaScript

How to hide a Table Column with jQuery

leave a comment »

One of the things I mostly need is a way to hide a table column fron view.

Lastly I have found how to do it with one line on jQuery code and the usage is simple.

$(document).ready(function() {
$('#btnHide').click(function() {
$('td:nth-child(2)').hide();
// if your table has header(th), use this
//$('td:nth-child(2),th:nth-child(2)').hide();
});
});

Thanks for that code to Suprotim Agarwal at DevCurry.com

Written by Alex (Shurf) Frenkel

May 18, 2010 at 3:55 pm

Posted in JavaScript, jQuery

Tagged with , ,