【发布时间】:2019-06-10 22:08:06
【问题描述】:
我需要将我正在创建的表格中的第一列(tbody 标记内)加粗。由于某种原因,正常的方法不起作用。我已经尝试过标签和字体粗细:粗体以及第一个孩子。我怀疑它与通过 TS 中的函数生成的行有关?我试图在函数中将文本设置为粗体,但似乎也无法做到这一点。我对此很陌生,所以也许我只是缺少一些简单的东西?任何帮助将不胜感激!
顺便正常生成表格。
tbody:first-child {
font-weight: bold;
}
<table class="table table-editable table-striped table-hover table- sortable" style="width:100%">
<thead class="thread-dark">
<tr>
<th style="width: 90px;">Team</th>
<th style="width: 90px;">Category</th>
<th style="width: 90px;">SWAG</th>
<th style="width: 90px;">Completed</th>
<th style="width: 90px;">Remaining</th>
<th style="width: 90px;">% Over/ Under SWAG</th>
</tr>
</thead>
<ng-template ngFor let-team [ngForOf]="gemEngineeringTeams">
<tbody team-list-row [engineeringTeam]="team"></tbody>
</ng-template>
</table>
【问题讨论】:
-
您的选择器应该是:
tbody tr td:first-child。