question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Support custom table styles

See original GitHub issue

Currently, the user can only specify a built-in style name when creating a worksheet table via the style option when calling add_table() and xlsxwriter always writes an empty tag to the tableStyles element. The Workbook class will need a new method for add_table_style() and the Styles class _write_table_styles() method will need to support writing the appropriate tags. I’ll submit a PR for this shortly.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
gblacksfcommented, Sep 18, 2017

Could you explain this a bit more.

Sure. When you call worksheet.add_table(), you can specify a style name in the options (http://xlsxwriter.readthedocs.io/working_with_tables.html), e.g. sheet.add_table('B3:F7', {'style': 'Table Style Light 11'}). This style name has to be a built-in style, you can’t create your own so you’re limited to the color/format choices that Excel gives you (21 light, 28 medium, and 11 dark themes).

It would be nice to be able to specify the format for a new table style, which we create through xlsxwriter, and then specify by name when calling worksheet.add_table().

Adding this functionality involves minimal changes to Packager._write_styles_file(), a few small changes to Styles._write_table_styles() and the addition of Workbook.add_table_style() as a public method (plus documentation and tests).

0reactions
jmcnamaracommented, Nov 10, 2019

Closing as I am unlikely to tackle this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table Styles in Success Snapshot - Gainsight Inc.
This article explains how admins can create, customize, and apply table styles to Tabular Reports in the Success Snapshot template.
Read more >
What to do custom table style - Document360
Table style is an important element in Document360 or for any possible avenue for creating a rich design layout for a document.
Read more >
Styling tables - Learn web development | MDN
This article provides a guide to making HTML tables look good, with some specific table styling techniques highlighted.
Read more >
Three Tips to Using Table Styles in MadCap Flare
1. Apply Styles to Multiple Topics at Once · 2. Create a “Custom” Type for Rows and Columns · 3. Include Header Rows...
Read more >
CKEditor 5 v17.0.0 with table styles and special characters
0.0 that introduces two major and frequently requested features: table styling support and the special characters plugin. In addition to that, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found