Generally, the colspan attribute of the <td> element is used to implement cell cross-column operations, and the rowspan attribute of the <td> element is used to implement cell cross-row operations. The colspan attribute specifies the number of columns a cell can span. All browsers support the colspan attribute. Its value is number, as shown in the following figure: For example: <table border="1"> <tr> <th>Monday</th> <th>Tuesday</th> </tr> <tr> <td colspan="2">Sunday</td> </tr> </table> The implementation result is shown in the figure below: The rowspan attribute specifies the number of columns a cell can span. All browsers support the rowspan attribute. Its value is number, as shown in the following figure: For example: <table border="1"> <tr> <td rowspan="2">Monday</td> <td>Tuesday</td> </tr> <tr> <td>Wednesday</td> </tr> </table> The implementation result is shown in the figure below: The use of colspan and rowspan is summarized as follows: <table border="1"> <tr> <th colspan="3">Material Details</th> </tr> <tr> <td colspan="2" align="center">Quantity (pieces)</td> <td rowspan="2">Weight (tons)</td> </tr> <tr> <td>Actual number of issuances</td> <td>Actual amount collected</td> </tr> <tr> <td>12</td> <td>10</td> <td>100.00</td> </tr> </table> The implementation result is shown in the figure below: This is the end of this article about HTML table cross-row and cross-column operations (rowspan, colspan). For more relevant HTML table cross-row and cross-column content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: Implementation of Single Div drawing techniques in CSS
>>: How to import CSS styles into HTML external style sheets
To do a paginated query: 1. For MySQL, it is not ...
We live in a visual world and are surrounded by m...
answer from stackflow: Simply <br> is suffic...
Linux version: CentOS 7 [root@azfdbdfsdf230lqdg1b...
For various reasons, sometimes you need to modify...
Preface: During database operation and maintenanc...
Table of contents Written in front router.json Ro...
Table of contents Preface Reference Comparison Ma...
How to view linux files Command to view file cont...
There are two ways to run .sh files in Linux syst...
Table of contents 1. prototype (explicit prototyp...
Table of contents Preface vue-cli 2.0 version vue...
1. Check whether event is enabled show variables ...
Table of contents 1. Command 2. docker-compose.ym...
Use JS to zoom in and out when the mouse is on th...