pdfkit-table
Advanced tools
Comparing version 0.1.39 to 0.1.40
35
index.js
@@ -74,3 +74,3 @@ "use strict"; | ||
const columnContainerWidth = usableWidth / columnCount; | ||
let columnContainerWidth = usableWidth / columnCount; | ||
const columnWidth = columnContainerWidth - columnSpacing; | ||
@@ -236,8 +236,18 @@ const maxY = this.page.height - this.page.margins.bottom; | ||
// background header | ||
// addBackground( startX, startY - 5, 100, rowHeight + rowSpacing ); | ||
// we have columnSizes[] complete | ||
if( columnIsDefined ){ | ||
// sum columns sizes | ||
columnContainerWidth = columnSizes.reduce((acc, curr, index ) => acc + curr, 0); | ||
console.log(columnContainerWidth); | ||
// background header | ||
const rectRow = { | ||
x: startX, | ||
y: startY - 5, | ||
width: columnContainerWidth, | ||
height: rowHeight + rowSpacing, | ||
} | ||
this.addBackground( rectRow ); | ||
lastPosition = startX; | ||
@@ -256,2 +266,11 @@ // print headers | ||
// background header | ||
const rectRow = { | ||
x: startX, | ||
y: startY - 5, | ||
width: columnContainerWidth * table.headers.length - 5, | ||
height: rowHeight + rowSpacing, | ||
} | ||
this.addBackground( rectRow ); | ||
// print headers | ||
@@ -285,3 +304,9 @@ table.headers.forEach((header, i) => { | ||
// background header | ||
// addBackground( lastPosition, startY - 5, width - 0, rowHeight + 3, '#EEE', 1 ); | ||
const rectRow = { | ||
x: lastPosition, | ||
y: startY - 5, | ||
width: width, | ||
height: rowHeight + rowSpacing, | ||
} | ||
this.addBackground( rectRow ); | ||
@@ -288,0 +313,0 @@ // write |
{ | ||
"name": "pdfkit-table", | ||
"version": "0.1.39", | ||
"version": "0.1.40", | ||
"description": "PdfKit Table. Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30118
444