Skip to content Skip to sidebar Skip to footer

Hide Columns In A Table Using CSS

I want to hide some of the columns in the table below. It is from a wordpress plugin so the ids and classes are predefined. I hope I can solve it with css fx: display:none, but I c

Solution 1:

You can use the nth-child selector in CSS to hide the columns you need. But in that case you need to hide that same th as well.

CSS:

table tr th:nth-child(1), table tr td:nth-child(1){
 display:none;// It will hide the first column of the table
}

Also check this for better understanding https://css-tricks.com/how-nth-child-works/


Solution 2:

Try to add in a separate .CSS (and call this .CSS in last in your head) and for example try

#company_name {
display: none; //If it doesn't work try visibility: hidden;
}

from w3school


Post a Comment for "Hide Columns In A Table Using CSS"