excel - Apply easyxf style for specific cell or row range only: xlwt Python -


i written few lines code..

book = xlwt.workbook() sheet = book.add_sheet('section details', cell_overwrite_ok=true) style_detail = xlwt.easyxf('font: name calibri, height 180,colour_index black;align: wrap on, vert center, horiz center; border : bottom thin,right thin,top thin,left thin;') sheet.write_merge(0, 0, 0, 0, 'product family') sheet.write_merge(1, 1, 0, 0, 'product category') sheet.write_merge(0, 0, 1, 1, 'product') . . sheet.write_merge(n, n, n, n, 'product') //n dynamic number.. 

now, after completing writing work. want apply style specific cells only(depending on requirement).

rw = sheet.row(1) rw.set_style(style_detail) 

if apply style specific row apply entire row of sheet(for column endless columns). how can apply style specific cell of row only?

please let know if more code or info require idea.

thanks in-advance.

you can add style object 6th argument of write_merge() function as

    sheet.write_merge(0, 0, 0, 0, 'product family',style_detail) 

and when want have default style, ignore 6th argument.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -