繁体   English   中英

在html和jquery中隐藏列th

[英]hiding a column th in html and jquery

我正在尝试在我的视图中隐藏ID th,我正在使用jquery数据表,仍然有隐藏它的方法吗? 我不想在我的html和JS前端看到它,如下所示。

HTML:

<thead>
   <tr>
     <th>Status</th>
     <th>ID</th> 
     <th>Upload Date</th>
     <th>File Name</th>
     <th>Bank</th>
     <th>Upload By</th>
     <th>filepath</th>
     <th>summarypath</th>
     <th>ACTION</th>
   </tr>
</thead>

JS:

"aoColumns": [
    { "sName": "FileStatus", "sClass": "left", "sWidth": "100px" },
    { "sName": "ID", "sClass": "left", "sWidth": "200px" },
    { "sName": "Crdt", "sClass": "left", "sWidth": "100px", "sType": "date" },
    { "sName": "FileName", "sClass": "left" },
    { "sName": "BankName", "sClass": "left", "sWidth": "100px" },
    { "sName": "Crid", "sClass": "left", "sWidth": "150px" },
    { "sName": "filepath", "sClass": "left", "sWidth": "10px", "bVisible": false },
    { "sName": "summarypath", "sClass": "left", "sWidth": "10px", "bVisible": false },
    { "sName": "", "sWidth": "100px", "bSearchable": false,  "bSortable": false, "fnRender": function (oObj) 

根据文档 ,您可以尝试:

"aoColumns": [
    { "sName": "FileStatus", "sClass": "left", "sWidth": "100px" },
    { "sName": "ID", "bVisible": false },
    { "sName": "Crdt", "sClass": "left", "sWidth": "100px", "sType": "date" },
    // Following the code

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM