Skip to content

Instantly share code, notes, and snippets.

View Chinwendu20's full-sized avatar
🎯
Focusing

Maureen Ononiwu Chinwendu20

🎯
Focusing
View GitHub Profile
@chadcooper
chadcooper / reportlab-table.py
Last active June 16, 2023 09:49
Create alternating row colors in table with Reportlab.
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.platypus import Table, TableStyle, Paragraph
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.styles import getSampleStyleSheet
styles = getSampleStyleSheet()
style = styles["BodyText"]
canv = Canvas("doc.pdf", pagesize=letter)