gpt4 book ai didi

javascript - 如何更改 jquery 数据表列的颜色

转载 作者:太空宇宙 更新时间:2023-11-04 09:51:42 24 4
gpt4 key购买 nike

我正在动态创建和填充 jquery 数据表,而无需事先根据从 ajax 调用收到的值声明列和行。现在我想更改我的数据表列标题颜色。下面是我的表格的标记。

 <div class="row" style="padding-top: 2em;">
<div class="col-sm-12">
<div class="row" style="padding-top: 2em;">
<div class="col-sm-12">
<table id="adt" class="table table-bordered table-hover compact table-striped" cellspacing="0" style="width: 100%">
</table>
</div>
</div>
</div>

在这种情况下如何更新列颜色?请帮忙

最佳答案

您可以使用简单的 css,例如:

#adt > thead > tr > th {
background-color: gray !important;
color: white !important;
}

关于javascript - 如何更改 jquery 数据表列的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39041065/

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