girdeux
girdeux

Reputation: 720

Python-docx, can I write symbols inside table?

Can I write symbols inside a cell of a table using Python-docx? let's say σ (sigma). So far I got:

from docx import Document

document = Document()
table = document.add_table(rows=2, cols=2)
table.style = 'TableGrid' #single lines in all cells

heading_cells = table.rows[0].cells 
heading_cells[0].text = '\sigma'

document.save('test.docx')

Upvotes: 1

Views: 971

Answers (1)

girdeux
girdeux

Reputation: 720

Actually, it works with:

heading_cells[0].text = 'σ'

Upvotes: 1

Related Questions