Table Header Styles are not being applied--very frustrated

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
CoolLime
Propeller Head
Posts: 41
Joined: Mon Apr 18, 2016 6:50 am
Location: Toronto, Canada

Table Header Styles are not being applied--very frustrated

Post by CoolLime »

Does anyone have any insight as to what could be wrong here--I set a style for headers in a table style sheet to be light gray. Sounds simple right? Well no matter what I try, the table style does not produce a table with a light gray header. I am really banging my head against the wall on this one. Am I missing something totally obvious?
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Table Header Styles are not being applied--very frustrat

Post by Nita Beck »

After creating a table and applying the table style, be sure to go into the table's Table Properties and set the number of header rows to something greater than 0, which is the default.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
CoolLime
Propeller Head
Posts: 41
Joined: Mon Apr 18, 2016 6:50 am
Location: Toronto, Canada

Re: Table Header Styles are not being applied--very frustrat

Post by CoolLime »

Thanks Nita, that was the obvious thing I was missing for the headers, clearly. Tables in Flare are frustrating me to no end, in the Print medium anyway. I suppose I do not have a great understanding of how to set options like widows and orphans and page breaks so that I get them to do what I want, especially with tables.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Table Header Styles are not being applied--very frustrat

Post by ChoccieMuffin »

I also find it useful to produce a nice, neat, empty table and save it as a snippet, so that I can just insert the snippet and convert it to text, rather than having to insert the table, apply the table stylesheet, open Properties, add header rows...

Think it was Nita who suggested it, and it's been a real boon to productivity.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Table Header Styles are not being applied--very frustrat

Post by Nita Beck »

Glad we got you squared away. Remember that a table stylesheet merely defines styles that can be applied to a table. It doesn't have anything to do with the structure of a given table, with how many header rows it might have or how many footer rows it might have.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Table Header Styles are not being applied--very frustrat

Post by Paulie »

CoolLime wrote:Thanks Nita, that was the obvious thing I was missing for the headers, clearly. Tables in Flare are frustrating me to no end, in the Print medium anyway. I suppose I do not have a great understanding of how to set options like widows and orphans and page breaks so that I get them to do what I want, especially with tables.
Out of interest, has anybody found a reliable way of controlling these via CSS. I ended up having to write a post-publishing macro for the Word outputs in order to prevent table rows from breaking across pages and to ensure that table headers were not orphaned.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
CoolLime
Propeller Head
Posts: 41
Joined: Mon Apr 18, 2016 6:50 am
Location: Toronto, Canada

Re: Table Header Styles are not being applied--very frustrat

Post by CoolLime »

I would love to know who has these aspects of tables under control in the Print medium, period...I find the interface, and possibly even the documentation, related to tables in Flare is something that they should seriously look at revamping.
devjoe
Sr. Propeller Head
Posts: 337
Joined: Thu Jan 23, 2014 1:43 pm

Re: Table Header Styles are not being applied--very frustrat

Post by devjoe »

Code: Select all

tr
{
	page-break-inside: avoid;
}
th
{
	page-break-after: avoid;
}
chrispitude
Propeller Head
Posts: 58
Joined: Thu Mar 23, 2017 12:23 pm

Re: Table Header Styles are not being applied--very frustrat

Post by chrispitude »

devjoe wrote:

Code: Select all

tr
{
	page-break-inside: avoid;
}
th
{
	page-break-after: avoid;
}
Did that work for you? page-break-after works for me on rows (tr), but not cells (th or td). Is this expected?

I can only prevent orphaned headers by creating a tr.header class, but that's not attractive to have to retrofit back into existing documentation.
chrispitude
Propeller Head
Posts: 58
Joined: Thu Mar 23, 2017 12:23 pm

Re: Table Header Styles are not being applied--very frustrat

Post by chrispitude »

Actually, I might have found a better solution. Originally, our tables were structured like this, using <th> for headers and <td> for data rows:

Code: Select all

<table>
 <tr><th>Header1</th><th>Header2</th></tr>
 <tr><th>Header3</th><th>Header4</th></tr>
 <tr><td>Data1</td><td>Data2</td></tr>
 <tr><td>Data3</td><td>Data4</td></tr>
</table>
I found that when I specifically classified the table contents as header and body with <thead> and <tbody>:

Code: Select all

<table>
 <thead>
  <tr><th>Header1</th><th>Header2</th></tr>
  <tr><th>Header3</th><th>Header4</th></tr>
 </thead>
 <tbody>
  <tr><td>Data1</td><td>Data2</td></tr>
  <tr><td>Data3</td><td>Data4</td></tr>
 </tbody>
</table>
the behavior was MUCH better. Headers were no longer orphaned, table row orphan/widow support worked, and table headers were repeated after page breaks. I ended up only needing this content change, with no changes to the style sheets.
devjoe
Sr. Propeller Head
Posts: 337
Joined: Thu Jan 23, 2014 1:43 pm

Re: Table Header Styles are not being applied--very frustrat

Post by devjoe »

It seemed to work for me. I have a table in my PDF output which has a header that would have been orphaned if not for this. I don't know if there are other differences, such as the use or lack thereof of thead tags, which affect this.
Post Reply