Td,th cannot set margin in table

Source: Internet
Author: User

First of all, what we need to know is that we can set the margin for table tables, not set padding, set padding for cell TD, and not set margin. So, we can't set the margin property on cell TD to adjust the distance between cells and cells, but we can use this method to achieve the same effect.
1) Set padding
As we have just said, we can set the Padding property on cell TD to adjust the spacing between cells
td{padding:5px 10px;}
2) Use the label
We can add a label to a cell TD and then set the margin property on the label
p{margin:5px 10px;}
3) Set border-spacing (ie not supported) on table tables
Let's start with a brief look at the Border-spacing property. Border-spacing:length; Sets the spacing between the sides of a cell TD in both landscape and portrait. When you specify a length value, this value is used for horizontal and vertical spacing, and when you specify two length values, the first one is used for horizontal spacing, and the second value is used for vertical spacing.
table{border-spacing:5px 10px;}

Td,th cannot set margin in table

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.