import pandas as pd
from styleframe import StyleFrame, Styler, utils
volume_dict = {'tag': pd.Series(['AA', 'AB', 'AC', 'AD', 'AE']),
'value': pd.Series(['sss', 'sdsd', 10.5, 10.6, 22.0]),
'cal': pd.Series(['', '', '=C3/C5', '=C4/C5', ''])}
volume_data_df = pd.DataFrame(volume_dict)
default_style = Styler(font_size=8)
cus_style = Styler(bg_color='#ccffff')
sf = StyleFrame(volume_data_df, styler_obj=default_style)
sf.apply_column_style(cols_to_style='tag',
styler_obj=cus_style,
overwrite_default_style=False)
sf2 = StyleFrame(volume_data_df, styler_obj=default_style)
sf2.set_column_width(columns=sf.columns, width=10)
sf2.apply_column_style(cols_to_style='tag',
styler_obj=cus_style,
overwrite_default_style=False)
ew = StyleFrame.ExcelWriter('my_excel.xlsx')
sf.to_excel(ew, sheet_name='11', startcol=1, startrow=0, header=False, index=False)
sf.to_excel(ew, sheet_name='11', startcol=5, startrow=0, header=True, index=False)
ew.save()
when use to.excel() with header=False, misal position has occurred
styleframe==3.0.5