cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to create border for sme specific cells?

databicky
Contributor II

i tried some code to create border for excel sheet, for particular cell iam able to write but while i am trying with some set of cells means it is showing error.โ€‹

1 ACCEPTED SOLUTION

Accepted Solutions

Chaitanya_Raju
Honored Contributor

Hi @Mohammed sadamuseanโ€‹ ,

Can you please try similar to below code using loops, I have implemented a similar use case that might be useful, please let me know if you need further

 top = Side(border_style = 'thin',color = '00000000')
 bottom = Side(border_style = 'thin',color = '00000000')
 left = Side(border_style = 'thin',color = '00000000')
right = Side(border_style = 'thin',color = '00000000')
border = Border(top = top,bottom = bottom,left = left,right = right)
 
for cell in sheet['C18:C56']:
      cell[0].fill = PatternFill("solid", start_color="00C0C0C0")
       cell[0].border = border

Happy Learning!!

Thanks for reading and like if this is useful and for improvements or feedback please comment.

View solution in original post

1 REPLY 1

Chaitanya_Raju
Honored Contributor

Hi @Mohammed sadamuseanโ€‹ ,

Can you please try similar to below code using loops, I have implemented a similar use case that might be useful, please let me know if you need further

 top = Side(border_style = 'thin',color = '00000000')
 bottom = Side(border_style = 'thin',color = '00000000')
 left = Side(border_style = 'thin',color = '00000000')
right = Side(border_style = 'thin',color = '00000000')
border = Border(top = top,bottom = bottom,left = left,right = right)
 
for cell in sheet['C18:C56']:
      cell[0].fill = PatternFill("solid", start_color="00C0C0C0")
       cell[0].border = border

Happy Learning!!

Thanks for reading and like if this is useful and for improvements or feedback please comment.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group