gpt4 book ai didi

CSS 表格交替行颜色和悬停颜色

转载 作者:行者123 更新时间:2023-12-01 09:14:16 25 4
gpt4 key购买 nike

<分区>

我有一张带有类表的表。到目前为止唯一的样式是 table th。我想使用 CSS 值在行的白色和银色之间交替,并为整行悬停银色。有人有相关代码吗?


<table class='table'>
<tr>
<th>heading</th>
<th>heading 2</th>
<th>heading 3</th>
</tr>
<tr class='table'>
<td>col 1</td>
<td>col 2</td>
<td>col 3</td>
</tr>
<tr class='table'>
<td>col 1</td>
<td>col 2</td>
<td>col 3</td>
</tr>
<tr class='table'>
<td>col 1</td>
<td>col 2</td>
<td>col 3</td>
</tr>
</table>

这是 html 示例(因为它是用 php 编写的)

CSS

.table {
background-color: #FFFFFF;
color: #000000;
}

.table th {
background-color: #333333;
color: #FFFFFF;
}

到此为止。寻找用于我猜测表 tr css 的值。


说不同是因为偶数/奇数不起作用,它是动态 php 而不是严格的 html。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com