jsPDF-AutoTable
jsPDF-AutoTable copied to clipboard
Cant get RowSpan to work properly with v3.5.15 - affecting page breaks
Hello, I am trying to export my table which has the first two columns with rows that span across 3-4 pages long at times. So sometimes the rowspan can equal 300+. I am finding that the PDF will print the first row of the table on the first page, and then split off to remaining pages. It is also dropping the border lines for these columns. I have set rowPageBreak: 'avoid' but it doesn't seem to make any difference.
I can't seem to find any resolution to this, as all documentation states that v3 addresses these issues. Would really appreciate some help on this.
Cheers
Sounds like a bug. Can you post a minimal example of the issue?
Thanks for the reply. Okay, I'll post some screen captures so you can see what I mean (sensitive info blacked out)...

My code so far looks like so:
autoTable( doc, {
html: 'table',
theme: 'grid',
//pageBreak: 'auto',
rowPageBreak: 'avoid',
startY: 120,
margin: { top: 10, right: 10, bottom: 10, left: 10 },
styles: {
font: 'helvetica',
//overflow: 'normal',
fontSize: 6,
valign: 'middle'
},
headStyles: { fillColor: [255, 255, 255], textColor: [0, 0, 0, 0.6], fontStyle: 'bold', fontSize: 5 },
didParseCell(data) {
console.log(data);
// Convert Header cells to uppercase
if( data.cell.section === 'head' ) {
data.cell.text = data.cell.text.toString().toUpperCase();
}
// Handle top alignment
if( data.cell.raw.className.toString().includes( 'align-text-top' ) ) {
data.cell.styles.valign = 'top';
}
// Handle center alignment
if( data.cell.raw.className.toString().includes( 'text-center' ) ) {
data.cell.styles.halign = 'center';
}
// Handle Subtotal Rows
if( data.cell.raw.parentElement.className === 'subtotalRow' ) {
data.cell.styles.textColor = '#000';
data.cell.styles.fillColor = '#EEE';
data.cell.styles.fontStyle = 'bold';
}
//Handle Client text
if( data.column.index < 2 ) {
//data.cell.text[1] === '<strong>' + data.cell.text[1] + '</strong>';
}
}
})
The example actually pushed out to more pages than shown as Column 1 spans about 300 odd rows, but as you can see, it only adds the first record on the first page and then continues on from page 2. It also drops the RHS border which isn't ideal.
I have tried pageBreak, rowBreak and overflow but nothing seems to make a difference.
Let me know if you need any other data/examples.
Cheers
Thanks. Seems like a clear bug. I'll tag it with the bug label 👌
I have exactly the same error. Would love to hear, when you found a fix! :)
I even get an error message:
jspdf.plugin.autotable.js:1255 The content of row 0 will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.
I understand the problem, that the height is bigger than the page-height. But the expected behaviour imo would be, to simply "split" the cell and display them on both pages
Hey @simonbengtsson .... just wanted to checkin and see if you had a approximate ETA on a fix for this? I understand you're probably busy, I just wanted to know roughly whether to wait for a fix or try and find some kind of work around, as I am wanting to deliver this report into production soon.
Cheers mate.
As far as I know there is no one working on this actively right now @RipleWare
I have the same issue. Is there a work around?
I have the same issue. Is there a work around?
I have the exactly issue like this. anybody know, how to fix this?
I have same issue with this, any update on the fix ?
Currently, rawSpan pageBreak isn't supported, this will change in v4, for now make sure rowSpans don't span multiple pages.
@trung37 Hello, I used the version you fixed and still had some minor problems; As shown in the following picture