I am trying to create a table with the FPDF library that is capable of expanding the height of the cells when the text is very large. I am going to show the code that I have, which is the same that appears on the official documentation page: from fpdf import FPDF data = ( ("First name", "Last name", "Age", "City"), ("Jules", "Smith", "34", "San Juan"), ("Mary", "Ramos", "45", "Orlando"), ("Carlson", "Banks", "19", "Los Angeles"), ("Lucas", "Cimon", "31", "Saint-Mahturin-sur-Loire udfhisudhf fughdiufhg fduihgsdiufg dfghsdifugh fdiguhdsfiug fdughdifugh dfhgsdiufhg"), ) pdf = FPDF() pdf.add_page() pdf.set_font("Times", size=10) line_height = pdf.font_size * 2.5 col_width = pdf.epw / 4 for row in data: for datum in row: pdf.multi_cell(col_width, line_height, datum, border=1, ln=3) pdf.ln(line_height) pdf.output('table_with_cells.pdf') this is the result: The last column of the last row is taller because it has more content, that's fine, but I would like the height of all columns in that row to be the same dynamically. Something like this: How can I get it? Note: The data that will be in the table comes from the database, so I can't know exactly the length of each string Continue reading...