HTML&CSS Basic Learning Note 15-merging cells

Source: Internet
Author: User

Merge cells

In the previous article, we have been able to create a simple table, if we need to put a horizontal two adjacent cells <td> or a longitudinal two adjacent cells <td> merge, what should we do? The knowledge points we want to know are as follows:

1. Label <td> [colspan] Properties Specifies the number of columns that a cell can span, that is, the number of horizontal merged cells;

2. The [rowspan] property of the label <td> specifies the number of rows that the cell can span, that is, the number of vertically merged cells;

3. These 2 tags can also be used Simultaneously.

Examples of styles:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/48/wKiom1fZ_RnBYlpGAAB7pz-BJ0E812.jpg-wh_500x0-wm_3 -wmp_4-s_443671614.jpg "title=" 3.jpg "alt=" wkiom1fz_rnbylpgaab7pz-bj0e812.jpg-wh_50 "/>

Try merging the cells Now:


  1. <! DOCTYPE HTML>

  2. < HTML lang="en">

  3. < Head >

  4.     < charset = "UTF-8" >     

  5. < title > Create a multi-row, multi-column table </title>

  6. </ Head >

  7. < Body >

  8. < H1 > Create a multi-row, multi-column table </H1>

  9. < Table Border="1">

  10. <TR><TD colspan="2">First cell</TD><TD>Second cell</TD><TD>A third cell</TD></TR>

  11. <TR><TDrowspan=' 2 '>Fourth cell</TD><TD>Fifth cell</TD><TD>Sixth cell</TD></TR>

  12. <TR><TD>Seventh cell</TD><TD>Eighth cell</TD><TD>Nineth cell</TD></TR>

  13. </ Table >

  14. </ Body >

  15. </ HTML >

The result is this: for more information, please go to http://www.mayacoder.com/lesson/index

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/45/wKioL1fZ_SSwLMhDAAAvXCLamEo927.png-wh_500x0-wm_3 -wmp_4-s_1272447014.png "title=" 6.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px; height:240px; "alt=" wkiol1fz_sswlmhdaaavxclameo927.png-wh_50 "/>


HTML&CSS Basic Learning Note 15-merging cells

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.