title: how to format specific cells in excel using xlsx package in python
body: <p>I have a pandas df which I am formatting using xlsx package currently I have the option to format an entire row or column using xlsx but not specific cells also I would like to insert few lines in between the DF. </p>
  
  <p>Image attached how I want the excel file to look.</p>
  
  <p>The below code gives me the file in the 1st part of the image. I need to do some more formatting like inserting new lines and making D13 and E13 in italics. <a href="https://i.stack.imgur.com/XEtps.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XEtps.jpg" alt="enter image description here"></a></p>
  
  <pre><code>writer = pd.ExcelWriter('Sample Report Test.xlsx' , engine='xlsxwriter')
  df.to_excel(writer , index= False , sheet_name='Sample Report')
  
  workbook = writer.book
  worksheet = writer.sheets['Sample Report']
  
  money_fmt = workbook.add_format({'num_format':'$#,##0' ,  'font_name':'Batang' })
  font_fmt = workbook.add_format({'font_name':'Batang' , 'bold':True })
  tot_fmt = workbook.add_format({'num_format':'$#,##0' ,  'font_name':'Batang' ,  'bold':True })
  
  worksheet.set_column('A:B' , 25 , font_fmt)
  worksheet.set_column('C:P' , 15 , money_fmt)
  worksheet.set_row(4, None , tot_fmt)
  worksheet.set_row(7 , None , tot_fmt)
  
  writer.save()
  </code></pre>