How can i hide certain table column in a HTML table using CSS

前端 未结 7 1649
长发绾君心
长发绾君心 2021-01-26 18:05

I have a html table which is as follows

You can then use jQuery to hide all cells that belong to a specific column...

$('td[data-col=1]').hide ();

You could also use the ':nth-child ()' css pseudo class but it is not supported by some IE browsers

Hope it makes sense

提交回复
热议问题
col1 c
7条回答
  •  既然无缘
    2021-01-26 18:38

    I've got no idea what's the intent, the reason or the audience but if you append a data attribute to each column cell...