【发布时间】:2019-05-27 10:52:44
【问题描述】:
我有一个从数据库中提取的 HTML 表。一些行与文本 null 一起出现,我想遍历此表并删除或隐藏其中包含文本 null 的任何行。
第一列将是循环遍历并找到“空”文本并删除该行的列,但我不知道该怎么做。
<table class="table table-striped" id="ex-table">
<thead class="thead-inverse">
<col width="120">
<col width="120">
<col width="120">
<tr>
<th bgcolor="#feaf3f">Item</th>
<th bgcolor="#feaf3f">Price</th>
<th bgcolor="#feaf3f">Sale Price</th>
</tr>
</thead>
<tbody>
<tr id="tr">
<td id="Item"></td>
<td id="Price"></td>
<td id="salePrice"></td>
</tr>
</tbody>
</table>
【问题讨论】:
-
一开始就不查询数据库中的那些条目不是更容易吗?
标签: javascript html loops