Learn how to create a zebra striped table with CSS.
First Name | Last Name | Points |
---|---|---|
Jill | Smith | 50 |
Eve | Jackson | 94 |
Adam | Johnson | 67 |
To create a zebra-striped table, use the nth-child()
selector and add a background-color to all even (or odd) table rows:
Go to our CSS Tables Tutorial to learn more about how to style tables.
Go to our CSS Selector Reference to learn more about the nth-child() selector.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!