我正在使用一个动态数据表,我需要Availability列中的文本 colored颜色 根据通用数据库中的包状态动态更改.具体来说,我希望"库存"是绿色的,而"缺货"是红色的.以下是HTML struct 的简化版本:
<div class="fd-datatable">
<div class="innerScrollContainer">
<div class="row" role="row" tabindex="0" aria-rowindex="1" aria-label="row">
<div aria-colindex="1" role="gridcell">
<!-- ... other columns ... -->
<div aria-colindex="4" role="gridcell">
<span>In Stock</span>
</div>
<!-- ... other columns ... -->
</div>
</div>
<!-- ... other rows ... -->
</div>
</div>
如何访问标记中每行的文本,以便更改其 colored颜色 using only CSS?