FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: update front-page example to use table style by ChenfromChina123 · Pull Request #1579 · python-openxml/python-docx · GitHub

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 6 additions & 2 deletions docs/index.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,19 @@ Here's an example of what |docx| can do:
'first item in ordered list', style='List Number'
)

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

records = (
(3, '101', 'Spam'),
(7, '422', 'Eggs'),
(4, '631', 'Spam, spam, eggs, and spam')
)

table = document.add_table(rows=1, cols=3)
table = document.add_table(rows=1, cols=3, style='Light Shading Accent 1')
hdr_cells = table.rows[0].cells
hdr_cells[0].text = 'Qty'
hdr_cells[1].text = 'Id'
Expand Down

Back | FazBrowse Home | New Git URL