Alex (SirShurf) Frenkel's Blog

A web log of a PHP professional

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

Advertisements

Written by Alex (Shurf) Frenkel

May 18, 2010 at 3:55 pm

Posted in JavaScript, jQuery

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: