Use CSS to control cellspacing and cellpadding

Source: Internet
Author: User
Use CSS to control cellspacing and cellpadding. Classification: it-Silbo @ pm

In table
Cellspacing and cellpadding are used to control the spacing between cells. By default, cellspacing and cellpadding are not 0,
In this situation, we often set cellspacing and cellpadding to 0, so we often see "<
Table cellspacing = 0
Cellpadding = 0>"Code. In this way, the size of the Code is virtually increased, and it does not comply with the web standards of style and content separation. For me, it is also extremely
So it is significant to use CSS to control the cellspacing/cellpadding display! The following are the control methods:

Table {border: 0; margin: 0; border-collapse: collapse ;}
Table TD {padding: 0 ;}

The first line controls cellspacing, the key is "border-collapse: collapse;"; the second line controls cellpadding. do few know how to control TD? :)

Related Article

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.