Skip to content

Table column with italic text #1070

Answered by Lucas-C
aritramhp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @aritramhp

Welcome to the fpdf2 community 😊

It's totally fine to ask such questions there, I would just recommend to provide some code with your message, to share what you tried so far 🙂

Anyway, could you try this code and tell if that fits your needs?

from fpdf import FontFace, FPDF

TABLE_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"),
)

ITALICS = FontFace(emphasis="ITALICS")
INDEX_OF_COLUMN_IN_ITALICS = 2

pdf = FPDF()
pdf.add_page()
pdf.set_font("Times", size=16)
with pdf.table() as table:…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aritramhp
Comment options

Answer selected by aritramhp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants