Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Increase Width of Datatable Excel Export

I am trying to increase the default with of datatable excel.

Currently, It looks like

enter image description here

I have tried :

oTable = $('#myTable').DataTable({
        dom: 'Bfrtip',
         buttons: [
                    
                    {
                        extend: 'excelHtml5',
                        exportOptions: {
                    columns: [ 0, 1, 2, 3 ]
                },
                customize: function (xlsx) {
  var sheet = xlsx.xl.worksheets['sheet1.xml'];
  var col = $('col', sheet);
  $(col[2]).attr('width', 40);
}
                    },
                    {
                        extend: 'pdf',
                        exportOptions: {
                    columns: [ 0, 1, 2, 3 ]
                }
                    }
                ]
    });

The button is working but it not setting to custom width.

Thank You.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!