Problem trying to hide a column using HTML / CSS

I need to hide the column, as well as other elements, when my page is printed, and for this I have a print stylesheet, everything works fine except for the column I want to delete, the strange thing is that my stylesheet works in IE, but it was not in Mozilla and Chrome; Why is this?

HTML code

<col width="10%" class="art-editcolumn"/> 

and here is the CSS class:

 .art-editcolumn { display: none; } 

I hope you can help me with this.

+4
source share
2 answers

The CSS display property is not allowed for the col tag . Only background, width and borders. Thus, standards-based browsers simply ignore it.

+3
source

Please note the following <col> tag entry: http://www.w3schools.com/TAGS/tag_col.asp

You will notice that in Firefox only the ONE attribute is supported: 'width'

Also from this link only CSS styles can be applied: "background", "width" and "border":

Add a style attribute to the <col> tag, and let CSS take care of the backgrounds, width and borders. These are ONLY CSS properties that work with the <col> .

Hope that helps :)

+1
source

Source: https://habr.com/ru/post/1335494/


All Articles