How to create border in Header? I am using jspdf autotable to create table but cannot find any idea to apply border to header. Is there any hook that can be used to create header border?
2 Answers
You can use the header styles:
doc.autotable(columns, data, { headerStyles: { lineWidth: 1, lineColor: [255, 0, 0] } }); 2 Comments
Edycar Reyes
Nice Simon!... but I've a question: What about if I want to only add the top and bottom borders?
Simon Bengtsson
Not supported by the library right now as far as I know.
As of today (version 3.5.25) the property name is headStyles and still different border widths is not supported.
Example:
autoTable(doc, { headStyles: { lineWidth: 0.5, // 1 is too thick for me lineColor: [255, 0, 0] // Or gray level single value from 0-255 } }) I use the imported method version (autoTable) in TypeScript.