Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mPDF: Hide table row (CSS display:none) not work

Tags:

css

php

mpdf

mPDF: Hide table row (CSS display:none) not work. Do you have any suggest? My code:

<table align="center">
    <tr style="display:none">
        <td valign="top" align="left">InfoOption1:</td>
        <td valign="top" align="left" colspan="2">#InfoOption1</td>
    </tr>
</table>
like image 382
Zeigen Avatar asked Aug 08 '14 11:08

Zeigen


People also ask

How do you hide a table in CSS?

Usually, to hide an element from view, you use the 'display' property and set it to 'none'. But CSS also has a property called 'visibility', which hides elements in a different way. In particular, we use 'visibility: collapse' here, which is designed especially for hiding table columns and rows.

What is opposite of display none?

display: none doesn't have a literal opposite like visibility:hidden does. The visibility property decides whether an element is visible or not. It therefore has two states ( visible and hidden ), which are opposite to each other.

What is difference between display none and visibility hidden?

Difference between display:none and visiblity: hiddenvisibility:hidden hides the element, but it still takes up space in the layout. display:none removes the element from the document. It does not take up any space.

How do you hide an element in a table?

The hidden attribute hides the <table> element. You can specify either 'hidden' (without value) or 'hidden="hidden"'. Both are valid. A hidden <table> element is not visible, but it maintains its position on the page.


1 Answers

I feel very dirty for posting this suggestion, but it's the best I got working:

<tr><td>...</td></tr>
<div style="display: none;">
    <tr><td>...</td></tr>
</div>

The DIV is the working part. Luckily, html validnes for seo isnt relevant for mPDF

like image 125
Martijn Avatar answered Sep 30 '22 22:09

Martijn