【发布时间】:2018-03-13 03:44:00
【问题描述】:
我想隐藏表中列的值,表的数据是从数据库绑定的
这是我的html代码
<table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
<thead>
<tr>
<th id="th_id_event">Id Event Category</th>
<th>Event Category</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<% objLOV.forEach(function (lov) { %>
<tr onclick="callme(this)">
<td id="td_id_event">
<%= lov.id %>
</td>
<td>
<%= lov.event_category %>
</td>
<td>
<%= lov.description %>
</td>
</tr>
<% }) %>
</tbody>
</table>
<% objLOV.forEach(function (lov) { %>是从数据库中获取数据
我试过这样,但是唯一的第一列第一行被隐藏了,我想隐藏列id的所有值
window.onload = function () {
document.getElementById("td_id_event").style.display = "none";
document.getElementById("th_id_event").style.display = "none";
};
my table after i tried to disable
谁能帮助我?谢谢你。。
【问题讨论】:
-
不要使用Id,使用class而不是Id
-
谢谢你.. @NitinDhomse
标签: javascript html hidden-field