: The Table Row Element - HTML - MDN Web Docs - Mozilla
Trang chủ » Html Table First Column Background Color
»
: The Table Row Element - HTML - MDN Web Docs - Mozilla
Có thể bạn quan tâm
This example extends the basic table from the previous example by adding a header row as the first row of the table.
HTML
An additional table row (<tr>) is added as the first row of the table with column header cells (<th>) providing a header for each column. We put this row in a <thead> grouping element to indicate this is the header of the table. The scope attribute is added to each header cell (<th>) within this head row to explicitly specify that each header cell relates to all the cells within its own column, even though those cells are in the <tbody>.
html<table> <thead> <tr> <th scope="col">Symbol</th> <th scope="col">Code word</th> <th scope="col">Pronunciation</th> </tr> </thead> <tbody> <tr> <th scope="row">A</th> <td>Alfa</td> <td>AL fah</td> </tr> <tr> <th scope="row">B</th> <td>Bravo</td> <td>BRAH voh</td> </tr> <tr> <th scope="row">C</th> <td>Charlie</td> <td>CHAR lee</td> </tr> <tr> <th scope="row">D</th> <td>Delta</td> <td>DELL tah</td> </tr> </tbody> </table> CSS
The CSS is nearly unchanged from the previous example, except for some additional styling to highlight the "header row" so that the headers of the columns stand out from the other cells.
csstr:nth-of-type(odd) { background-color: #eee; } tr th[scope="col"] { background-color: #505050; color: #fff; } tr th[scope="row"] { background-color: #d6ecd4; } table { border-collapse: collapse; border: 2px solid rgb(140 140 140); font-family: sans-serif; font-size: 0.8rem; letter-spacing: 1px; } th, td { border: 1px solid rgb(160 160 160); padding: 8px 10px; } Result
Từ khóa » Html Table First Column Background Color
-
How To Make First Column Of A Row Black And Second Column Red
-
How To Set Background Color In The First Column Of A Table (HTML ...
-
Coloring CSS Tables - HTML
-
Tr Bgcolor Is Obsolete: Here's How To Set Table Row Background ...
-
Why Table Bgcolor Is No Longer Valid Code (And What To ... - HTML
-
Table Colors & Background : MGA - Web Development Tutorials
-
HTML Table Styling - W3Schools
-
How To Change The Background Color Of An HTML Table - ThoughtCo
-
Setting Table Colors - Documentation For Action Request System 21.3
-
HTML And CSS Tutorial: How-To's And Miscellaneous
-
HTML Table Basics
-
Change Background Color Of First Column In Pivot T... - Qlik Community
-
HTML Table Basics - Learn Web Development | MDN
-
How To Structure An HTML Document? - ETSAV
Liên Hệ
TRUYỀN HÌNH CÁP SÔNG THU ĐÀ NẴNG
Địa Chỉ: 58 Hàm Nghi - Đà Nẵng
Phone: 0904961917
Facebook: https://fb.com/truyenhinhcapsongthu/
Twitter: @ Capsongthu
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu
Trang chủ » Html Table First Column Background Color »
Có thể bạn quan tâm
This example extends the basic table from the previous example by adding a header row as the first row of the table.
HTML
An additional table row (<tr>) is added as the first row of the table with column header cells (<th>) providing a header for each column. We put this row in a <thead> grouping element to indicate this is the header of the table. The scope attribute is added to each header cell (<th>) within this head row to explicitly specify that each header cell relates to all the cells within its own column, even though those cells are in the <tbody>.
html<table> <thead> <tr> <th scope="col">Symbol</th> <th scope="col">Code word</th> <th scope="col">Pronunciation</th> </tr> </thead> <tbody> <tr> <th scope="row">A</th> <td>Alfa</td> <td>AL fah</td> </tr> <tr> <th scope="row">B</th> <td>Bravo</td> <td>BRAH voh</td> </tr> <tr> <th scope="row">C</th> <td>Charlie</td> <td>CHAR lee</td> </tr> <tr> <th scope="row">D</th> <td>Delta</td> <td>DELL tah</td> </tr> </tbody> </table>CSS
The CSS is nearly unchanged from the previous example, except for some additional styling to highlight the "header row" so that the headers of the columns stand out from the other cells.
csstr:nth-of-type(odd) { background-color: #eee; } tr th[scope="col"] { background-color: #505050; color: #fff; } tr th[scope="row"] { background-color: #d6ecd4; } table { border-collapse: collapse; border: 2px solid rgb(140 140 140); font-family: sans-serif; font-size: 0.8rem; letter-spacing: 1px; } th, td { border: 1px solid rgb(160 160 160); padding: 8px 10px; }Result
Từ khóa » Html Table First Column Background Color
-
How To Make First Column Of A Row Black And Second Column Red
-
How To Set Background Color In The First Column Of A Table (HTML ...
-
Coloring CSS Tables - HTML
-
Tr Bgcolor Is Obsolete: Here's How To Set Table Row Background ...
-
Why Table Bgcolor Is No Longer Valid Code (And What To ... - HTML
-
Table Colors & Background : MGA - Web Development Tutorials
-
HTML Table Styling - W3Schools
-
How To Change The Background Color Of An HTML Table - ThoughtCo
-
Setting Table Colors - Documentation For Action Request System 21.3
-
HTML And CSS Tutorial: How-To's And Miscellaneous
-
HTML Table Basics
-
Change Background Color Of First Column In Pivot T... - Qlik Community
-
HTML Table Basics - Learn Web Development | MDN
-
How To Structure An HTML Document? - ETSAV
Liên Hệ
TRUYỀN HÌNH CÁP SÔNG THU ĐÀ NẴNG
Địa Chỉ: 58 Hàm Nghi - Đà Nẵng
Phone: 0904961917
Facebook: https://fb.com/truyenhinhcapsongthu/
Twitter: @ Capsongthu
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu