No way to control line spacing inside table cell
glebarez opened this issue · 2 comments
glebarez commented
Hello, I can't figure out a way to control line spacing inside table cell.
Currently the default setting is too large, and seems like a whole empty line is in between.
Is there a way to shrink it ?
Code
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.set_font("helvetica")
with pdf.table(first_row_as_headings=False) as table:
row = table.row()
row.cell("line1\nline2")
pdf.output("test.pdf")
Result
Lucas-C commented
Hi @glebarez!
Have you checked the line_height
setting? It's mentioned there in the docs:
- https://py-pdf.github.io/fpdf2/Tables.html#setting-row-height
- https://py-pdf.github.io/fpdf2/fpdf/table.html#fpdf.table.Table
with pdf.table(first_row_as_headings=False, line_height=5) as table:
glebarez commented
Thanks, it worked!