Home > Article > Web Front-end > Recommend an article using th, colgroup, col to define table styles_Experience exchange
Define the style of each column of the table. You don’t need to add a bunch of Classes to each td. You can easily do it by using attributes such as th, colgroup, col, etc. ^_^
The code is as follows:
TagName | ClassName | CSS |
---|---|---|
table | Demo | border-collapse: collapse; color: #454545; font: 11px/150% Verdana, Arial, Helvetica, sans-serif; |
th | padding: 3px 7px; border: 1px solid #f60; border-width: 2px 1px 1px; background: #ffffe1; | |
td | padding: 3px 7px; border: 1px solid #f60; | |
col | Col1 | text-align: right; background: #f5f5f5; |
col | Col2 | color: #00c; |
col | Col3 | font-style: italic; |