The use of table in HTML code across 2 rows and 2 columns

Source: Internet
Author: User

Always write a 2-column HTML code, do not write across the 2 lines of the example, look for opportunities to study a bit!
First of all, this is a good understanding of the 2-column example.


Example 1 spans 2 columns:

TableBorder= "1">
2<Tr>
3<Tdcolspan= "2"Align= "Center">111</Td>
4</Tr>
5<Tr>
6<Td>222</Td>
7 <TD>333</td>
8 </TR>
9 </table>


The display results are as follows:

111
222 333


The HTML code is always read one line at a time, first read the 1th line, hit the colspan=2 so that the pre-occupied 2 column position
Then the 2nd line reads the first column, then the 2nd column.



Example 2 right across 2 lines:

TableBorder= "1">
2<Tr>
3<Td>111</Td>
4<TdRowSpan= "2">222</Td>
5</Tr>
6<Tr>
7 <td>333</td>
8                 </ tr>
9            </table>


The display results are as follows:

111 222
333


The HTML code reads the 1th row 1th column, then reads to the 2nd column when encounters the rowspan=2, then reserves the 2 row the position
Then read the 2nd row, column 1th.



Example 3 left across 2 lines:

TableBorder= "1">
2<Tr>
3 <TdRowSpan= "2">111</Td>
4<Td>222</Td>
5</Tr>
6<Tr>
7 <td>333</td>
8                 </ tr>
9            </table>


The display results are as follows:

111 222
333




Example 4 is combined across 2 rows and across 2 columns:

<TableBorder= "1">
2<Tr>
3 <TdRowSpan= "2">111</Td>
4<Td>222</Td>
5<Td>333</Td>
6 </Tr>
7<Tr>
8<Td>444</Td>
9<Td>555</Td>
10 </Tr>
11<Tr>
12<Td>666</Td>
13<td colspan= "2" Span style= "color: #0000ff;" >>777</td>
14                  </tr>
15             </table>



111 222 333
444 555
666 777


Start reading the 1th row 1th column, reserve 2 lines, read out the 1th row of 2, 3 columns,
Then read the 2nd row of 1, 2 columns, and then read the first column of line 3rd, and later
Reread the 2nd column across 2 columns.

The use of table in HTML code across 2 rows and 2 columns

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.