Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce vertical spacing between rows #887

Closed
muggleveela opened this issue Jun 2, 2022 · 5 comments
Closed

Reduce vertical spacing between rows #887

muggleveela opened this issue Jun 2, 2022 · 5 comments

Comments

@muggleveela
Copy link

muggleveela commented Jun 2, 2022

I am not able to reduce the vertical line spacing between table rows (default value is currently 1.15). It remains at 1.15 line spacing.

const doc: any = new jsPDF('landscape');
const rows = [];
const cols = ['Amount','Description'];
const title = 'Sales details';

rows.push(...this.getSalesData());
doc.lineHeightProportion = 0.5; 
doc.setLineHeightFactor(0.5);

doc.autoTable(cols, rows, {
      styles: {
        lineHeight: 0.5 // not working 
      },
      head: [
         [{ content: title, colSpan: 6, styles: { halign: 'center', cellPadding: 10 } }],
      ],
      startY: 10,
      theme: 'plain',
      didParseCell: (data) => {
        if (data.section === 'body') {
         data.cell.styles.fontStyle = 'bold';
        }
      }
});
``
![XNgR1](https://user-images.githubusercontent.com/106766278/171684775-22b112c2-a31c-457e-9720-ac6a1db84840.png)
`
@simonbengtsson
Copy link
Owner

You likely have to reduce the font size. There is no option for lineHeight as far as I know.

@muggleveela
Copy link
Author

muggleveela commented Jun 3, 2022

Thank you, but I need my font size fixed to 12 and row line spacing less than 1.15. Will there be any release soon to cater for this issue? Is there any other package that offers this flexibility please?

@simonbengtsson
Copy link
Owner

No one is working on this as far as a I know, but would be a great addition if you want to look into it!

@github-actions
Copy link

This issue will soon be closed since issues in this project are mainly meant to be bugs or feature requests. Questions are directed to stackoverflow.

@mmghv
Copy link
Collaborator

mmghv commented Oct 10, 2023

Released in v3.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants