How to set fixed width for <td> in HTML

I'm trying to use a table element to align text for printing on A4 page using simple HTML that got perfect alignment that prints fine on paper, but when I print a different name, td changes and I lose the alignment of the paper because I have paper glued with fields such as a name that has already been printed, so I need the right wording to print it in the same section on paper. any solution for this?

<table width = 100% border =1>      
<tr>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> 
            <td>&nbsp;&nbsp;&nbsp;&nbsp;</td> 
            <td align = "right"><my><?php echo $name;?></my></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;&nbsp;</td>
            <td align = "center"><my><?php echo $rollno;?></my></td>
            <td>&nbsp;</td>         
            <td>&nbsp;&nbsp;</td>
</tr></table>
+4
source share
1 answer

table-layout: fixed table width: ? ( ? width, ) td.

, html , : border="1".

+4

All Articles