在 html 和 jquery 中隐藏第 th 列

hiding a column th in html and jquery

我正在尝试隐藏我视图中的 ID,我正在使用 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) 

根据documentation,你可以试试:

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