i want to make excel value to center align and have a yellow background color. But i can't input too many arguments. So i try this one but it's nothing happen. Is there any other way to do it?
colorCenter = xlwt.XFStyle()
xlwt.add_palette_colour("custom_colour", 0x21)
wb.set_colour_RGB(0x21, 255, 255, 0)
color = xlwt.easyxf('pattern: pattern solid, fore_colour custom_colour')
colorCenter.color = color
alignment = xlwt.Alignment()
alignment.horz = xlwt.Alignment.HORZ_CENTER
center = xlwt.XFStyle()
colorCenter.center = center
sheet.write(11, 3, 'value', colorCenter)
use easyxf is the best. you can put align, font, and pattern
colorCenter = easyxf('pattern: pattern solid, fore_colour yellow;'
'align: horiz center;')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With