Saving style of the header of StyleFrame object to excel

0 votes
The header's style is not saved to the xls file when I use sf.to excel() to save a StyleFrame object. The header of an Xls file always displays in Arial 12, which seems to be a default. My sf.columns[0] immediately before invoking sf.to excel(). The font I want is in container.style.font (Calibri), however the header in the xls file is in Arial 12. XLS data rows, however, are acceptable because they reflect the style I maintained on SF's data rows.

Is it possible to modify the style of the header when using sf.to excel()?
Nov 20, 2022 in Others by Kithuzzz
• 38,010 points
398 views

1 answer to this question.

0 votes

The correct way to style the headers is to use the apply_headers_style method:

from StyleFrame import StyleFrame, Styler

sf = StyleFrame({'a': [1, 2], 'b': [3, 4]})
sf.apply_headers_style(Styler(font='Calibri'))
sf.to_excel().save()

This will style all the headers. A workaround if you want to style only the first column's header:

from StyleFrame import StyleFrame

sf = StyleFrame({'a': [1, 2], 'b': [3, 4]})
sf.columns[0].style.font = 'Calibri'
sf._has_custom_headers_style = True
sf.to_excel().save()
answered Nov 20, 2022 by narikkadan
• 63,420 points

Related Questions In Others

0 votes
2 answers

What are the applications of artificial neural networks?

Artificial neural network is a computational model ...READ MORE

answered Mar 2, 2019 in Others by SA
• 1,090 points
2,288 views
+2 votes
2 answers
0 votes
2 answers

How to get the URL of the current tab in Google Chrome?

Its so simple.... If you want to ...READ MORE

answered Aug 12, 2020 in Others by Steve
• 200 points
3,067 views
0 votes
0 answers

AtoX: Leading the new height of public blockchain’s development

What is the public blockchain? It is easy ...READ MORE

Jan 25, 2019 in Others by anonymous
438 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,072 views
0 votes
1 answer
0 votes
1 answer

how to show the <meta> values of yoast seo with some function?

check this folder : wordpress-seo\src\presenters\open-graph you can ...READ MORE

answered Feb 10, 2022 in Others by narikkadan
• 63,420 points
410 views
0 votes
1 answer

What is the max length of page titles for SEO?

google displays only 50-60 words of a ...READ MORE

answered Feb 14, 2022 in Others by narikkadan
• 63,420 points
256 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP