HTML There are two ways to make tables in :
(1) First, draw the original table , Each is a single cell , Then merge the rows or columns according to the requirements , Some tables need to merge rows and columns , It is also divided into two steps , Join parallel then merge columns ( Or we can combine them first and then parallel them ), If it's done colspan and rowspan Merger of , Then the cells in the same row or column will be deleted , But this method is more troublesome , It's easy to confuse .
(2) Operate directly according to the final table to be generated , Treat each merged cell as a small cell , Don't split it anymore , Then write the table line by line , Write the merged cells directly colspan or rowspan, Next, if you encounter a merged cell that has been used , It is no longer included , Just see how many cells are left . This method is written line by line , No need to delete cells , Quite clear .
The following is a simple table and its code :
<!doctype html> <html> <head> <meta charset="utf-8"> <title> form </title> </head>
<h3 align="center"> Project supplement </h3> <table border="1" height="500" width="1000"
cellspacing="0" align="center"> <tr align="center"> <td> Serial number </td>
<td> Maintenance items and replacement parts </td> <td> Unit Price </td> <td> number </td> <td> Subtotal </td> <td> Man hour fee </td> <td> total </td>
<td> Cause of failure </td> </tr> <tr align="center"> <td>1</td> <td></td> <td></td>
<td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr align="center">
<td>2</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td>
<td></td> </tr> <tr align="center"> <td>3</td> <td></td> <td></td> <td></td>
<td></td> <td></td> <td></td> <td></td> </tr> <tr align="center"> <td>4</td>
<td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr
align="center"> <td>5</td> <td></td> <td></td> <td></td> <td></td> <td></td>
<td></td> <td></td> </tr> <tr align="center"> <td>6</td> <td></td> <td></td>
<td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr align="center"> <td
rowspan="4">7</td> <td></td> <td colspan="2" rowspan="4"></td> <td
rowspan="4"></td> <td rowspan="4"></td> <td rowspan="4"></td> <td
rowspan="4"></td> </tr> <tr align="center"> <td></td> </tr> <tr align="center">
<td></td> </tr> <tr align="center"> <td></td> </tr> <tr > <td
colspan="2"> Subtotal of spare parts :</td> <td colspan="5"> Subtotal of man hour expenses :</td> <td> total :</td> </tr>
</table> <table height="50" width="900" align="center"> <tr> <td> Foreman :</td>
<td> Technology Department :</td> <td> Service Consultant :</td> <td> Customer confirmation :</td> </tr> </table> <body> </body>
</html>
Technology