HTML table edge stitch

Source: Internet
Author: User

Pure CSS:

 

1. Declare in Table CSS: border-collapse: collapse; border-Spacing: 0;

2. declared in the CSS of th TD: padding: 0;

 

Semi-pure CSS:

 

1. Same as above.

2. <table cell-padding = "0 ".............

 

For details, see:

 

Http://www.dreamdu.com/xhtml/attribute_cellpadding_cellspacing/

 

Http://www.haoxiai.net/wangzhanzhizuo/cssjiaocheng/50293.html

 

 

Reference:

 

The cellpadding and cellpadding of the table are often used to clear the default style as follows: <br/> <Table cellspacing = "0" cellpadding = "0"> </table> <br/> many friends may say that the structure is not compliant with the standard, some friends may be confused about how to show this performance. We can use the border-collapse: collapse; attribute of table to replace cellspacing = "0", and the padding: 0 attribute of th and TD to replace cellpadding = "0 ". <Br/> table {<br/> border-collapse: collapse; <br/> border-Spacing: 0; <br/>}< br/> TH, TD {<br/> padding: 0; <br/>}< br/> you can also use expression to implement the cellpadding = "0" style: <br/> table {<br/> border-collapse: collapse; <br/> border-Spacing: 0; <br/> padd: expression (this. cellpadding = 0); <br/>}< br/> let's take a look at the description of these two attributes in the book "getting started with HTML and CSS (version 7th: <br/> the style attribute can be used for table settings. For example, you can use the cellpadding and cellspacing attributes to control the padding of table borders. The cellspacing attribute sets the spacing (in pixels) between table borders and table cells. The cellpadding attribute sets the spacing (in pixels) between information in cells ). If the cellpadding attribute is set to 0, all information in the table is as close as possible to the table border, or even to the border. The cellpadding and cellspacing attributes allow you to fully control the appearance of a table. <Br/> Note: although the cellpadding and cellspacing attributes are still allowed in XHTML, the style attributes padding and border-spacing equivalent to these two attributes exist in CSS. However, the current web browser does not support these style attributes, so we recommend that you still use the attributes cellpadding and cellspacing to adjust the table spacing. <Br/> in the book "proficient in CSS", the author advocates the following methods: <br/> table {<br/> border-collapse: collapse; <br/>}< br/> <Table cellpadding = "0"> </table> <br/> as to which method is best, you may decide on your own. 

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.