我有一个 html 表格,我想设置表格字体的样式,
table,
thead,
th {
color: white;
border: 1px solid black;
}
<table class="table table-bordered">
<thead>
<tr style="background-color:#3173AD;">
<th>Action</th>
<th style="color:white; font-size:10pt;">User Name</th>
<th style="color:white; font-size:10pt;">User Type</th>
<th style="color:white; font-size:10pt;">Department</th>
<th style="color:white; font-size:10pt;">Mobile Number</th>
<th style="color:white; font-size:10pt;" ng-hide="true"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in getdata">
<td>
<a href="#" ng-click="update(data)" class="btn btn-warning active fa fa-edit"></a>
<a href="#" ng-click="delete(data)" class="btn btn-danger active fa fa-remove"></a>
</td>
<td>{{data.Username}}</td>
<td>{{data.usertype}}</td>
<td>{{data.designation}}</td>
<td>{{data.mobilenumber}}</td>
<td ng-hide="true">{{data.userautoid}}</td>
<td ng-hide="true">{{data.profile}}</td>
<td ng-hide="true">{{data.picname}}</td>
<td ng-hide="true">{{data.email}}</td>
<td ng-hide="true">{{data.hod}}</td>
</tr>
</tbody>
</table>
但是 th
的字体颜色没有改变
以下是我用的,但无法更改颜色
<th style="">User Name</th>
这就是我现在正在做的来解决这个问题
<th style="color:white; font-size:10pt;" ng-hide="true"></th>
这工作正常,但我想使用 css 类
我现在还需要做什么?
原文由 user6656728 发布,翻译遵循 CC BY-SA 4.0 许可协议
你现在的 css 改变了 th 的字体颜色。但它也会改变整个表格或广告区域的字体颜色。
如果您的要求是仅为 th 更改字体颜色,那么我更喜欢以下 css: