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