WaxingFervor
unread,Apr 13, 2011, 4:28:26 PM4/13/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-excel
I would like to outline a block of cells, say 10 rows tall by 20
columns wide.
I see in the tutorial python-excel.pdf (author: thanks for that btw)
on page 42 that there is a little description of how to do this. It
says:
Writing a single cell with borders is simple enough, however applying
a border to a group
of cells is painful as shown in this example:
from xlwt import Workbook,easyxf
tl = easyxf('border: left thick, top thick')
t = easyxf('border: top thick')
tr = easyxf('border: right thick, top thick')
r = easyxf('border: right thick')
br = easyxf('border: right thick, bottom thick')
b = easyxf('border: bottom thick')
bl = easyxf('border: left thick, bottom thick')
l = easyxf('border: left thick')
w = Workbook()
ws = w.add_sheet('Border')
ws.write(1,1,style=tl)
ws.write(1,2,style=t)
ws.write(1,3,style=tr)
ws.write(2,3,style=r)
ws.write(3,3,style=br)
ws.write(3,2,style=b)
ws.write(3,1,style=bl)
ws.write(2,1,style=l)
Is there an easier way to do this? In VB I would assign that block of
cells to an object and then tell Excel to put an outer border on.