Is it possible to separately style column headers and row values? I tried this but it generates same style for both. I am only keen on different font-size and font-color.
from fpdf import FPDF
from fpdf.fonts import FontFace
data = (
("First name", "Last name", "Age", "City"),
("Jules", "Smith", "34", "San Juan"),
("Mary", "Ramos", "45", "Orlando")
)
pdf = FPDF()
pdf.add_page()
pdf.set_font(family="Helvetica", style="B", size=12)
# Table
font_color_header = (0, 0, 0)
font_color_cell = (255, 0, 0)
headings_style = FontFace(color=font_color_header, size_pt=18)
cell_style = FontFace(color=font_color_cell, size_pt=9)
with pdf.table(headings_style=headings_style) as table:
for data_row in data:
row = table.row()
for datum in data_row:
row.cell(text=datum, style=cell_style)