How Should I Create Tables with Header Columns?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Gene K
Propeller Head
Posts: 28
Joined: Mon Apr 13, 2020 1:56 pm

How Should I Create Tables with Header Columns?

Post by Gene K »

Hello,

I know that the <th> scope attribute allows creating tables with a header column rather than row. However, this option seems to be missing from the "Insert Table" tool and is separate from table styles (which only apply CSS). I would like to avoid manually restructuring my tables whenever I want to use a header column; is there some elegant way of automating that through Flare?
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

Re: How Should I Create Tables with Header Columns?

Post by techwriter31 »

In our table styles, I added a custom column style for this. After applying the table style, you can right-click the column and select the custom column style. While not completely automated, it does prevent the need for inline formatting. (I also added a custom row style that mimics the appearance of our heading rows, and specify the custom row style for these cases.)

Originally, I had a separate table style for cases where we needed a header column, but this resulted in more table styles, and more maintenance overhead.
Kellie
Gene K
Propeller Head
Posts: 28
Joined: Mon Apr 13, 2020 1:56 pm

Re: How Should I Create Tables with Header Columns?

Post by Gene K »

techwriter31 wrote:In our table styles, I added a custom column style for this. After applying the table style, you can right-click the column and select the custom column style. While not completely automated, it does prevent the need for inline formatting.
Thank you! This helped me realize that I didn't need to worry about preserving the <thead> and <th> tags in header column tables; I should never run into a situation where the table breaks horizontally across pages anyway (meaning I don't need to worry about repeating a header for it). Derp.
techwriter31 wrote:(I also added a custom row style that mimics the appearance of our heading rows, and specify the custom row style for these cases.)
Originally, I had a separate table style for cases where we needed a header column, but this resulted in more table styles, and more maintenance overhead.
To clarify, you use your custom row when you need to add extra "header" rows later in your table, correct?
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

Re: How Should I Create Tables with Header Columns?

Post by techwriter31 »

Gene K wrote:To clarify, you use your custom row when you need to add extra "header" rows later in your table, correct?
Exactly! We don't use this very often, but there are a few cases where we need a row to appear as if it's a "header" row. But as you mentioned with the header columns, this pseudo header row won't repeat on subsequent pages like a true header row will (if configured in the .css to repeat).

Another thing I did to streamline the table style maintenance was to extract as many table styles as I could and put them into our standard .css. For example, the common td, th, thead, table, etc., styles we want to use across all tables. Then the table styles only specify the settings specific to that particular table (background colors for table headers, etc.).
Kellie
Gene K
Propeller Head
Posts: 28
Joined: Mon Apr 13, 2020 1:56 pm

Re: How Should I Create Tables with Header Columns?

Post by Gene K »

techwriter31 wrote:
Gene K wrote:To clarify, you use your custom row when you need to add extra "header" rows later in your table, correct?
Exactly! We don't use this very often, but there are a few cases where we need a row to appear as if it's a "header" row. But as you mentioned with the header columns, this pseudo header row won't repeat on subsequent pages like a true header row will (if configured in the .css to repeat).

Another thing I did to streamline the table style maintenance was to extract as many table styles as I could and put them into our standard .css. For example, the common td, th, thead, table, etc., styles we want to use across all tables. Then the table styles only specify the settings specific to that particular table (background colors for table headers, etc.).
Gotcha, that makes perfect sense. Thanks again for the pointers, and helping me get around a mental block of trying to force the <thead> to behave exactly like I wanted it to.
Post Reply