how to hide table columns in jQuery?

Posted by understack on Stack Overflow See other posts from Stack Overflow or by understack
Published on 2010-04-07T20:53:19Z Indexed on 2010/04/07 21:03 UTC
Read the original article Hit count: 321

Filed under:
|
|
|

I've a table with lots of columns. I want to give users the option to select columns to be shown in table. These options would be checkboxes along with the column names. So how can I hide/unhide table columns based on checkboxes?

Would hiding (using .hide()) each td in each row work? May be I can assign checkbox value to the location of column in table. So first checkbox means first column and so on. And then recursively hide that 'numbered' td in each row. Would that work?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about table