My table has 13 columns. How can I get different width for each column? Can I give each column width like this?
styles: {overflow: 'linebreak' ,columnWidth: [100,80,80,70,80,80,70,70,70,70,60,80,100]},
My table Syntax:
> var res = doc.autoTableHtmlToJson(document.getElementById(tableID));
> doc.autoTable(res.columns, res.data, { styles: {overflow: 'linebreak'
> ,columnWidth: [100,80,80,70,80,80,70,70,70,70,60,80,100]}, startY:
> 60, bodyStyles: {valign: 'top'}, });
By default the 'columnsStyles' dont have in 'Options', that's necessary create it and next step you define the 'columnWidth'.
You would have to transform your columnWidth array to look like this:
Note the use of
columnStyles
instead ofstyles
.In previous release (1.3.4) it could have done like below:
But the latest one i.e. 2.3.2 requires the below format
This will fix only id, name, role, and location to the specified limits. Rest other headers will be adjusted accordingly by autotable.js
Let's say,[ steps,Methods,process,Delivers,Results ] are all my Table Headers.If i want to increase or decrease table width mean's ,
Here you can specify the each column width.