4

I am trying to write some data on excel file, and want to keep first row text orientation as 90 degree.

style = xlwt.easyxf('font: bold 0, color black, underline 0,height 250; alignment: horizontal left')
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
Deepak Dubey
  • 309
  • 1
  • 3
  • 12

1 Answers1

5

Here's an example how you can do this:

import xlwt

style = xlwt.easyxf('align: rotation 90')

workbook = xlwt.Workbook()
worksheet = workbook.add_sheet('Test')
worksheet.write(0, 0, label='Formatted value', style=style)
workbook.save('test.xls')

You can use rota or rotation keyword.

FYI, here's the function being called under the hood.

Hope that helps.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195