What to look for when setting a table CSS style

Source: Internet
Author: User
We know that if there are a lot of CSS styles in the table, today we will give you a detailed explanation of the table TR TD CSS style setting, and what to pay attention to when setting up a CSS stylesheet for table tables

A table table tag is used in multiple places on a Web page, and setting the style for the specified Table object can still be controlled by CSS.

In fact, sometimes we think that it's much easier to put a table tag as a div tag to set up CSS.

Set style on table

Name the table style within the specified object by corresponding table parent style

Case Complete HTML+CSS Code

<! DOCTYPE html> 

Summary

The CSS style settings above are specified by the parent table and TD.

By setting a separate ID or class for the table

Table layout is used in many places, this time if you directly set the table label style, this time the table table layout will be set. At this point, you only need to set the table plus ID or class to differentiate the CSS style for table settings.

Set CSS on table TD

In the table page layout, generally need to set the TD style, such as the TD set line High, padding, etc. are effective.

Complete the HTML+CSS code as follows:

<! DOCTYPE html> 

Set the style effect on TD in the specified table

Above through the CSS point, set the table in the specified object TD style.

Divergent thinking: If you want to set different CSS styles for a particular table TD, you can implement different style settings for TD Plus class.

Believe that you have seen these cases you have mastered the method, more wonderful please pay attention to the PHP Chinese network other related articles!

Related reading:

How to make div self-adapting height

How to hide the text content of the picture background with CSS

Common methods of native JS collation

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.