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>
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With