pytablewriter icon indicating copy to clipboard operation
pytablewriter copied to clipboard

Add styling support for Excel (binary) format

Open jimkohl opened this issue 4 years ago • 5 comments

I really like the patterns setup here. Looks like the various styling options for tables are not supported for Excel. The default font is WAY too small and I want also to BOLD headers. I tried using the patterns laid out (and it is even stated they aren't supported). Is there a plan for adding this?

Any suggestions as to how I can force this to a bigger font? I'll dig into the code more but I think this would be a huge value. Thanks jim

jimkohl avatar Dec 10 '19 13:12 jimkohl

Also have tried using panda but that's not working either :(.

jimkohl avatar Dec 11 '19 11:12 jimkohl

I just decided to mess w the objects hanging off of pytablewriter instead to get rid of the difficult to read choice of font / size: self.writer.open(file_path) self.writer = self.tableWriterClass() self.writer.MAX_CELL_WIDTH = 15 self.format_table['header']['font_name'] = "Arial" self.format_table['header']['font_size'] = 14 self.default_format['font_size'] = 14 self.default_format['font_name'] = "Arial"

I'm sure there's more brute force stuff to discover ahead, but it would really be good if the various cell styling things followed patterns of Markdown, etc. such as column centering.

jimkohl avatar Dec 12 '19 01:12 jimkohl

Thank you for your feedback.

Unfortunately, Excel writer classes have not supported style settings for now. However I have plan to support that feature.

thombashi avatar Jan 01 '20 06:01 thombashi

If there is anything I can do to help would love to make this a reality!

Sent from my iPhone

On Jan 1, 2020, at 1:07 AM, Tsuyoshi Hombashi [email protected] wrote:

 Unfortunately, Excel writer classes have not supported style settings for now. However I have plan to support that feature.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jimkohl avatar Jan 01 '20 18:01 jimkohl

Lovely project @thombashi ! I have the same issue as @jimkohl and ended up solving it the same way. However I believe that a quick and dirty fix would be just to set Default.FONT_NAME = 'Arial' Then the style would be just fine and the whole need would disappear. Frankly I believe that 'MS Gothic' is not the best default font for an Excel ;) Thanks again for your efforts and giving us this great lib!

stezz avatar Nov 07 '20 07:11 stezz