from openpyxl import Workbook workbook = Workbook() worksheet = workbook.worksheets[0] worksheet.title = "Sheet1" worksheet.cell('A1').style.alignment.wrap_text = True worksheet.cell('A1').value = "Line 1\nLine 2\nLine 3" workbook.save('wrap_text1.xlsx')
Neither wrap_text
or wrapText
work
from openpyxl import Workbook
from openpyxl.styles import Alignment
wb = Workbook()
ws = ws.active
ws['A1'] = "Line 1\nLine 2\nLine 3"
ws['A1'].alignment = Alignment(wrapText=True)
wb.save("wrap.xlsx")
--
You received this message because you are subscribed to a topic in the Google Groups "openpyxl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpyxl-users/LdCzH3bQOog/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpyxl-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.