how can I remove th tag or all colums in the head table

how can I remove th tag or all colums in the head table

alderhernandezalderhernandez Posts: 33Questions: 11Answers: 1
edited September 2016 in Free community support

i i want to delete all the th tag in my table or all the colums in my table.. for example

<table id="tblReporte">
                 <tr>
                <th>Name</th><-----i want to delete the th tag or the colum
                <th>Position</th><-----i want to delete the th tag or the colum
                <th>Office</th><-----i want to delete the th tag or the colum
                <th>Age</th><-----i want to delete the th tag or the colum
                <th>Start date</th><-----i want to delete the th tag or the colum
                <th>Salary</th>
                </tr>
<tbody>
            <tr>
                <td>Tiger Nixon</td>
                <td>System Architect</td>
                <td>Edinburgh</td>
                <td>61</td>
                <td>2011/04/25</td>
                <td>$320,800</td>
            </tr>
</tbody>

                  </table>

Can someone help me plis!!

Answers

  • alderhernandezalderhernandez Posts: 33Questions: 11Answers: 1

    i make it with

     $('#tblReporte').DataTable().destroy();      
                          var x = $("#tblReporte > tbody > tr:first > td").length;
                          for (var i = 0; i < x+1; i++) {
                            $('#tblReporte thead').find('th:eq('+i+')').remove();
                          };$('#tblReporte thead').find('th:eq(0)').remove();
    
    
This discussion has been closed.