2
<table>
    <thead>
        <tr>
            <th colspan="4" align="center">This is header</th>
        </tr>
        <tr>
            <th>S.No</th>
            <th>Class Name</th>
            <th>Section</th>
            <th>Enrollment Code</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>1st</td>
            <td>A</td>
            <td>101</td>
        </tr>
        <tr>
            <td>1</td>
            <td>1st</td>
            <td>A</td>
            <td>101</td>
        </tr>
    </tbody>
</table>

The above is my table with header colspan and rowspan, for the table i am adding data table plugin as below

$('table').DataTable({
            "scrollX": true,
            "paging": true,
            "bSort": false,
            "sScrollXInner": "100%",
            "lengthMenu": [[50, 100, 500, -1], ["50", "100", "500", "All"]],
            dom: 'Bfrtip',
            buttons: [
                'excelHtml5',
            ]
        });

while i am click on the export button it remove the first row and export remaining data how to allow the colspan and rowspan in export excel in datatable plugin. please help me.

DEVASISH BEHARA
  • 115
  • 3
  • 11

0 Answers0