Table merges cells colspan and rowspan.

Source: Internet
Author: User

colspanrowspan这两个属性用于创建特殊的表格。

colspanis the abbreviation for column span (cross-column). colspan attribute is used in the TD label to specify the number of columns that the cell spans horizontally :


The following will be displayed in the browser:

Cell 1
Cell 2 Cell 3 Cell 4

The example colspan is set to "3" so that the cell spans three columns. If we set it to colspan "2", the cell will only span two columns, so it is necessary to insert another cell in the first row to ensure that the two rows occupy the same number of columns.


The example will appear in the browser as follows:

Cell 1 Cell 2
Cell 3 Cell 4 Cell 5
rowspan Specifies the number of rows that the cell spans vertically .


The browser will appear as follows:

Cell 1 Cell 2
Cell 3
Cell 4

In the previous example, cell 1, which rowspan is set to "3", means that the cell must span three rows (itself, plus two other lines). Therefore, cell 1 and cell 2 are on the same line, and cell 3 and cell 4 form two separate lines.

Comprehensive examples

Ss

<table border= "1" width= ">"
<tr>
<TD colspan= "4" >ss

</td>
</tr>
<tr>
<TD width= "25%" > </td>
<TD width= "25%" > </td>
<TD width= "25%" > </td>
<TD width= "25%" > </td>
</tr>
<tr>
<TD width= "25%" rowspan= "2" > </td>
<TD width= "25%" > </td>
<TD width= "25%" > </td>
<TD width= "25%" > </td>
</tr>
<tr>

<TD width= "25%" > </td>
<TD width= "25%" rowspan= "3" > </td>
<TD width= "25%" > </td>
</tr>
<tr>
<TD width= "25%" colspan= "2" > </td>
<TD width= "25%" > </td>


</tr>
<tr>
<TD width= "25%" > </td>
<TD width= "25%" > </td>
<TD width= "25%" > </td>

</tr>
</table>

Table merges cells colspan and rowspan.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.