Change width of columns to be exported as pdf

Change width of columns to be exported as pdf

shadygshadyg Posts: 1Questions: 1Answers: 0

im using the html5 exports button and some of the columns im exporting does not match the pdf layout i have this colomn where the width is 150px to show the content of the <td> properly but when i exported it the layout was destroyed here is the code i used

<script type="text/javascript">
        $(document).ready(function() {
            var currentDate = new Date()
            var day = currentDate.getDate()
            var month = currentDate.getMonth() + 1
            var year = currentDate.getFullYear()
         
            var d = day + "-" + month + "-" + year;
            $('#detailTable').DataTable( {
                dom: 'Bfrtip',
                buttons: [ 
                    {
                        extend: 'pdfHtml5',
                        title: d+ ' Modules',
                        orientation: 'landscape',
                        pageSize: 'LEGAL',
                        exportOptions: {
                            columns: [ 0, 1, 2, 3, 4, 5, 6]
                        }
                    }
                 ]
            } );
        });
    </script>

any ideas?

This discussion has been closed.