Skip to content

Commit d2ff9c1

Browse files
docs: update front-page example to use table style
1 parent e454546 commit d2ff9c1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

docs/index.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ Here's an example of what |docx| can do:
4040
'first item in ordered list', style='List Number'
4141
)
4242

43-
document.add_picture('monty-truth.png', width=Inches(1.25))
43+
try:
44+
document.add_picture('monty-truth.png', width=Inches(1.25))
45+
except FileNotFoundError:
46+
# the image is optional; the example works without it
47+
pass
4448

4549
records = (
4650
(3, '101', 'Spam'),
4751
(7, '422', 'Eggs'),
4852
(4, '631', 'Spam, spam, eggs, and spam')
4953
)
5054

51-
table = document.add_table(rows=1, cols=3)
55+
table = document.add_table(rows=1, cols=3, style='Light Shading Accent 1')
5256
hdr_cells = table.rows[0].cells
5357
hdr_cells[0].text = 'Qty'
5458
hdr_cells[1].text = 'Id'

0 commit comments

Comments
 (0)