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
Table of contents Axios Request Qs processing dat...
Primitive values -> primitive types Number S...
byzhangxinxu from https://www.zhangxinxu.com/word...
Develop a number guessing game that randomly sele...
SQL implements addition, subtraction, multiplicat...
Modify the group to which a user belongs in Linux...
You can use the ps command. It can display releva...
As the company's influence grows and its prod...
Given a div with the following background image: ...
1. The use of or syntax in MySQL, and the points ...
I remember that a few years ago, there was an int...
Congratulations on finally convincing your bosses...
This article shares the specific code of React to...
Three useful codes to help visitors remember your...
It took me three hours to install MySQL myself. E...