layui table表格隐藏控制示例(节选):
html部分(创建一个表格):
<table class="layui-table" style="table-layout:fixed;" id="audio_table">
<colgroup>
<col text-align=“center” width="30%">
<col text-align=“center” width="70%">
</colgroup>
<tbody>
<tr>
<td >
<label class="layui-form-label" style="left: -55px; top: 10px;" langID="html:video_setting.audio_stream" id="audio_enable"></label>
</td>
<td>
<div class="layui-input-inline" style="top: 5px;">
<input type="checkbox" name="audio_stream" id="audio_stream" lay-filter="audio_stream" lay-text="ON|OFF" lay-skin="switch">
</div>
</td>
</tr>
</tbody>
</table>
JS部分:
var audio_enable = document.getElementById('audio_table');
audio_enable.style.display = 'none';
audio_enable.style.display = '';
|