Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give table width and height in millimeters in HTML

Tags:

html

Is there a way to give HTML table width and height in millimeters?

<table border="1">
 <tr width="17mm">
        <td>gukgu</td>
        <td>gukgu</td>
 </tr>
</table> 

Is this works?

like image 750
HaK Avatar asked Oct 30 '25 20:10

HaK


2 Answers

Yes, you can set widths in millimetres. However, setting a width on a <tr> element usually doesn't do anything. Instead, consider adding this style to the table: width:17mm; table-layout:fixed

like image 165
Niet the Dark Absol Avatar answered Nov 01 '25 10:11

Niet the Dark Absol


You can using css, however it is only recommended for print. For display on screen, you use em, px or %.

<table border="1">
 <tr>
        <td style="width: 17mm;">gukgu</td>
        <td style="width: 17mm;">gukgu</td>
 </tr>
</table>

See the manual

See a demo

like image 23
Kermit Avatar answered Nov 01 '25 10:11

Kermit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!