From d5764f7dbf7995f113951fcee89fc955f1cdba67 Mon Sep 17 00:00:00 2001 From: Jan Kobler Date: Wed, 9 Aug 2023 20:56:13 +0200 Subject: [PATCH] use cell_fill_mode cell_fill_logic is no longer an argument of Table see https://py-pdf.github.io/fpdf2/fpdf/table.html#fpdf.table.Table Signed-off-by: Jan Kobler --- tutorial/tuto5.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutorial/tuto5.py b/tutorial/tuto5.py index 7aba4387a..169e919db 100644 --- a/tutorial/tuto5.py +++ b/tutorial/tuto5.py @@ -1,6 +1,7 @@ import csv from fpdf import FPDF from fpdf.fonts import FontFace +from fpdf.enums import TableCellFillMode with open("countries.txt", encoding="utf8") as csv_file: @@ -25,7 +26,7 @@ with pdf.table( borders_layout="NO_HORIZONTAL_LINES", cell_fill_color=(224, 235, 255), - cell_fill_logic=lambda i, j: i % 2, + cell_fill_mode=TableCellFillMode.ROWS, col_widths=(42, 39, 35, 42), headings_style=headings_style, line_height=6,