Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- examples.long = function () {
- var doc = new jsPDF('l')
- var head = headRows()
- head[0]['text'] = 'Text'
- var body = bodyRows(4)
- body.forEach(function (row) {
- row['text'] = faker.lorem.sentence(100)
- })
- doc.text("Overflow 'ellipsize' with one column with long content", 14, 20)
- doc.autoTable({
- head: head,
- body: body,
- startY: 25,
- // Default for all columns
- styles: { overflow: 'ellipsize', cellWidth: 'wrap' },
- // Override the default above for the text column
- columnStyles: { text: { cellWidth: 'auto' } },
- })
- doc.text(
- "Overflow 'linebreak' (default) with one column with long content",
- 14,
- doc.lastAutoTable.finalY + 10
- )
- doc.autoTable({
- head: head,
- body: body,
- startY: doc.lastAutoTable.finalY + 15,
- rowPageBreak: 'auto',
- bodyStyles: { valign: 'top' },
- })
- return doc
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement