simonbengtsson / jsPDF-AutoTable

jsPDF plugin for generating PDF tables with javascript
https://simonbengtsson.github.io/jsPDF-AutoTable/
MIT License
2.32k stars 625 forks source link

halign - Justify #974

Open enertisbd opened 1 year ago

enertisbd commented 1 year ago

Hi,

This is a suggestion... Modify the justify alignment code to not apply the word spacing in the last line of the paragraph. It make the text more readable, specially when the last paragraph contains a few words, or even two words only.

Cheers!

simonbengtsson commented 1 year ago

Make sense to me!

mmghv commented 1 year ago

It's already looking pretty reasonable :

image

doc.autoTable({
  head: [['Lorem']],
  body: [['Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore quaerat tempora harum, voluptate tenetur, omnis magnam sed quod dolorum unde ipsum ad. Officiis, iure modi. Culpa maiores ratione odio adipisci!']],
  theme: 'grid',
  tableWidth: 105,
  styles: {
    halign: 'justify',
  },
})
loganscodes commented 7 months ago

But line breaks are not working