Tables Style Sheet and How to Apply Styles
-
Bambina_Mena
- Propeller Head
- Posts: 39
- Joined: Tue Jul 23, 2013 4:42 pm
Tables Style Sheet and How to Apply Styles
Hi. I've successfully imported a Word file in order to create a new Flare project. It came in clean with the exceptions of bullets and, of course, table work. Here is the thing. No one in my department has ever done a Word import (only me). However, we've our department-developed stylesheets and one of those stylesheets is our approved tables stylesheet. I copied the tables stylesheet into my Content/Resources/Stylessheet directory. The thing is... how to do go about accessing the table styles to actually apply them to a table of two or three? When I open the Styles window, the tables styles do not appear. Thanks.
Re: Tables Style Sheet and How to Apply Styles
Select the table itself, right click and select the option to apply the table stylesheet from the pop-up menu that appears. I think it's probably called Table Styles - I'm not on my PC st present. Then you can select your table Stylesheet from the list.
If you have lots of tables in your document to apply the table stylesheet to, you can apply a Stylesheet en masse by opening the table stylesheet and clicking the button to do that. I can't remember what this one is called - something like Assign to All probably. I just assign my most common table Stylesheet, then go through and change the rest manually.
A word of warning - you will find that your tables have all imported without headers even if they had them in Word.
This needs a manual fix to set the number of header rows for each table. This is easiest individually if there are only a few tables, or if like me, you have 294 (in the doc I'm in the act of importing) using a FAR HTML script.
If you have lots of tables in your document to apply the table stylesheet to, you can apply a Stylesheet en masse by opening the table stylesheet and clicking the button to do that. I can't remember what this one is called - something like Assign to All probably. I just assign my most common table Stylesheet, then go through and change the rest manually.
A word of warning - you will find that your tables have all imported without headers even if they had them in Word.
This needs a manual fix to set the number of header rows for each table. This is easiest individually if there are only a few tables, or if like me, you have 294 (in the doc I'm in the act of importing) using a FAR HTML script.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
Re: Tables Style Sheet and How to Apply Styles
PS. Table stylesheets usually go in a folder called Table Stylesheets, not with the ordinary stylesheets. Again, I'm not on my PC so can't check the actual name. It's probably best to put them where Flare expects them.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
-
Bambina_Mena
- Propeller Head
- Posts: 39
- Joined: Tue Jul 23, 2013 4:42 pm
Re: Tables Style Sheet and How to Apply Styles
Msquared, thank you very much. That worked!
Also -- I'm not complaining - but for some reason all of my table headers came over on the import.
Once again, thanks for your assistance.
Also -- I'm not complaining - but for some reason all of my table headers came over on the import.
Once again, thanks for your assistance.
Re: Tables Style Sheet and How to Apply Styles
I am jealous. What have you got that I haven't to make Flare preserve Word table header rows on import? Flare 10 perhaps?
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
-
SteveS
- Senior Propellus Maximus
- Posts: 2090
- Joined: Tue Mar 07, 2006 5:06 pm
- Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
- Contact:
Re: Tables Style Sheet and How to Apply Styles
I'm wondering if whoever made the tables in word selected the table property for repaeat this row as a header (or whatever its called, or however word recognises headers) and Flare recognised those rows as headers.Msquared wrote:I am jealous. What have you got that I haven't to make Flare preserve Word table header rows on import? Flare 10 perhaps?
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Re: Tables Style Sheet and How to Apply Styles
I made the tables in Word. There is only me here.
They are definitely set as headers in Word. When my very first trial import to Flare stripped all the table header rows, the first thing I checked was whether there was an alternative way to specify header rows in Word that I had missed.
There are quite a few posts here about restoring headers in imported Word content, so it's not just me. I'm just finishing the import of a 400 page reference document with 294 tables, and it's driven me to purchase FAR HTML to fix them, which several of you rave about, since I couldn't face deriving and testing regexes to cover every possible option.
They are definitely set as headers in Word. When my very first trial import to Flare stripped all the table header rows, the first thing I checked was whether there was an alternative way to specify header rows in Word that I had missed.
There are quite a few posts here about restoring headers in imported Word content, so it's not just me. I'm just finishing the import of a 400 page reference document with 294 tables, and it's driven me to purchase FAR HTML to fix them, which several of you rave about, since I couldn't face deriving and testing regexes to cover every possible option.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
-
Bambina_Mena
- Propeller Head
- Posts: 39
- Joined: Tue Jul 23, 2013 4:42 pm
Re: Tables Style Sheet and How to Apply Styles
Hi Msquared,
I am using Flare 9. I checked my Word file/version of the document and sure enough -- Repeat Header Rows is turned on.
Most definitely, the table headers all appear in Flare. So, you think it is the Repeat Header Rows feature in Word causing table headers to appear for me?
I've another tables question... what tables property must I set to ensure the text within a column is to the left (not to the far right within the column)? All of my table text is appearing to the right within the tables. However, it is not flush-right --- just towards the right (instead of to the left as it should be). I've checked various settings but cannot get to the bottom of it. Thanks.
I am using Flare 9. I checked my Word file/version of the document and sure enough -- Repeat Header Rows is turned on.
Most definitely, the table headers all appear in Flare. So, you think it is the Repeat Header Rows feature in Word causing table headers to appear for me?
I've another tables question... what tables property must I set to ensure the text within a column is to the left (not to the far right within the column)? All of my table text is appearing to the right within the tables. However, it is not flush-right --- just towards the right (instead of to the left as it should be). I've checked various settings but cannot get to the bottom of it. Thanks.
Re: Tables Style Sheet and How to Apply Styles
What margin does your default <p> style have in your ordinary stylesheet? Mine is 70pt, for my print outputs, and because of the way that Flare codes the table cell content, that setting gets inherited for the table cells, and I've had to hack the Flare-generated table stylesheets to fix it.
What happens is that if you only have one paragraph in a table cell, Flare puts it in a <td> tag, which you have no doubt specified a setting for in the table stylesheet, probably with margin 0, because that's what you usually do for tables. However, as soon as you add a second paragraph in the same cell, Flare adds a <p> tag around each paragraph in the table cell. And here's where the bug comes into play. Flare does not set up the table stylesheet so that the <p> style inherits whatever you had defined as the <td> style. It just leaves the <p> style in tables to inherit whatever your normal <p> style has. In my case, and I suspect in yours, this has a margin.
Also, note that sometimes Flare seems to add a <p> tag to table cell content on import from Word, and sometimes it doesn't. So even if you think that none of your table cells contain more than one paragraph, and hence don't have any <p> tags, you may find that they have, and hence have the bug too.
The fix is to add an extra style definition to your table stylesheet - the one that Flare should have added in the first place. This will do the trick (if you are using Flare 9 - the table stylesheet definitions and naming conventions seem to change from release to release). Here's what I've added to my (Flare 9) stylesheet - you'll note that as well as the margin-left setting, I've also added a couple of other things that I think Flare left out, just to be on the safe side.
GLOBAL_FullWidthTable is the name of my table stylesheet, and what this is saying is, for every <p> tag inside a TableStyle-GLOBAL_FullWidthTable class (which is one of the table classes that Flare generates automatically and applies as needed) set these attributes.
One final word of warning. Make sure you have a safe copy of this stylesheet. If you edit the table stylesheet from within Flare later on, Flare will probably take this definition out again.
I really should get round to reporting this and the original issue as bugs.
What happens is that if you only have one paragraph in a table cell, Flare puts it in a <td> tag, which you have no doubt specified a setting for in the table stylesheet, probably with margin 0, because that's what you usually do for tables. However, as soon as you add a second paragraph in the same cell, Flare adds a <p> tag around each paragraph in the table cell. And here's where the bug comes into play. Flare does not set up the table stylesheet so that the <p> style inherits whatever you had defined as the <td> style. It just leaves the <p> style in tables to inherit whatever your normal <p> style has. In my case, and I suspect in yours, this has a margin.
Also, note that sometimes Flare seems to add a <p> tag to table cell content on import from Word, and sometimes it doesn't. So even if you think that none of your table cells contain more than one paragraph, and hence don't have any <p> tags, you may find that they have, and hence have the bug too.
The fix is to add an extra style definition to your table stylesheet - the one that Flare should have added in the first place. This will do the trick (if you are using Flare 9 - the table stylesheet definitions and naming conventions seem to change from release to release). Here's what I've added to my (Flare 9) stylesheet - you'll note that as well as the margin-left setting, I've also added a couple of other things that I think Flare left out, just to be on the safe side.
GLOBAL_FullWidthTable is the name of my table stylesheet, and what this is saying is, for every <p> tag inside a TableStyle-GLOBAL_FullWidthTable class (which is one of the table classes that Flare generates automatically and applies as needed) set these attributes.
Code: Select all
/* Added to adjust p styles inside tables. Flare doesn't set these up correctly and
they end up inheriting styles from the body p style. That's a Flare bug I think! */
.TableStyle-GLOBAL_FullWidthTable p
{
mc-hyphenate: never;
mc-next-tag: p;
margin-bottom: 0pt;
margin-top: 4pt;
margin-left: 0pt;
line-height: 10pt;
}Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Tables Style Sheet and How to Apply Styles
Alternatively, add a complex selector to your stylesheet, where you can define how a <p> inside a <td> behaves.
Here's an extract from my stylesheet (print medium), so you get the idea. Don't forget to do all your mediums.
td p
{
vertical-align: top;
text-align: left;
margin-left: 0in;
}
Here's an extract from my stylesheet (print medium), so you get the idea. Don't forget to do all your mediums.
td p
{
vertical-align: top;
text-align: left;
margin-left: 0in;
}
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Tables Style Sheet and How to Apply Styles
The paragraph (p) tag will inherit styles from the table cell (td) tag.Msquared wrote:Flare does not set up the table stylesheet so that the <p> style inherits whatever you had defined as the <td> style. It just leaves the <p> style in tables to inherit whatever your normal <p> style has. In my case, and I suspect in yours, this has a margin.
But the styles you don't want are just what you've set for the paragraph (p) tag - so it's nothing to do with inheritance.
As LTinker mentioned, use the complex selctor td p { ... } to define how paragraphs appear inside table cells.
You may want to do this for lists too; i.e. td ol { ... } and td ul { ... }
Msquared wrote:One final word of warning. Make sure you have a safe copy of this stylesheet. If you edit the table stylesheet from within Flare later on, Flare will probably take this definition out again. :-( I really should get round to reporting this and the original issue as bugs.
Don't put the style definition in the table stylesheet file, put it in your main topic stylesheet.
The table stylesheet is regenerated whenever you edit it.
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Tables Style Sheet and How to Apply Styles
Blimey, I've been promoted to goddess status! 
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Tables Style Sheet and How to Apply Styles
Sorry, I should probably have been more specific. My reply was dashed off in a bit of a hurry in between more pressing (work-related) things.The paragraph (p) tag will inherit styles from the table cell (td) tag.
For my default medium, in my table stylesheets, the <p> tag does not inherit the <td> margin setting, but it does correctly inherit many of the other settings from the <td> element, like font, font size, text-align etc. It seems to be just the margin and a few other settings that get missed (those are the things that I set manually in the CSS fragment above). I think this is a bug, as it should indeed inherit them all. At least, that is the case for Flare 7, 8 and 9. I've not tried it in Flare 10 yet.
In order for the bug to be observed, you need to have a non-zero margin-left setting on your <p> tag in your default medium. Or, to be more precise, in order for the bug to be observed, you need to have a different margin setting on your <p> tag in your default medium from the one you have set for the <td> elements. but since most of us probably have a left margin of 0 for table cell items, that scenario is less likely. I guess also many of us also have a left margin setting of 0 for <p>, which is why this has slipped through the cracks.
If you create a table from scratch, one paragraph in a cell is fine, as Flare just codes that as <td> with the appropriate auto-generated table cell class, which correctly has a cell left margin of 0. But as soon as you enter a CR and type the second paragraph, Flare adds <p> tags, and then, in my case, I immediately get a 70pt indent unless I have applied the stylesheet change as above (70pt is the indent for my <p> tag in my default medium in my normal stylesheet). When I import from Word, I find that some table cells with single paragraphs arrive with <p> tags, and some don't. So some look OK on import, and some don't, without my hack.
However, when I get a minute, I am going to try Dave's suggestion of adding my hack to <p> elements within the <td> element, rather than <p> elements within the table class, since Flare changes the names of the table classes from release to release, and as you say, sometimes when you edit the table stylesheet from within Flare, removes it altogether. So I'm also going to try moving it to my ordinary stylesheet. I must admit that I didn't think of doing either of those - initially I was just pleased to have understood enough of the CSS in the table stylesheet to work out what had happened and what I needed to do to fix it.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Tables Style Sheet and How to Apply Styles
Msquared, I don't have anything set in my default medium, but in my Print medium <p> is indented by an inch or so, but <td> has 0 left margin. The very simple addition of the complex selector I listed fixes it beautifully.
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Tables Style Sheet and How to Apply Styles
Hi Choccie
The point I'm making is that you do have to do something to fix the bug. I'll willingly admit that your and Dave's suggested fixes are cleaner and better than mine for lots of reasons. I'll be replacing my bodge with your better bodge soon.
But the fact is that when you set up your tables and define row/column/cell styles, Flare correctly uses your defined styles to set the font, background, text alignment etc for both the <td> element and the contained <p> element, and sets the chosen margin-left setting for the <td> style but forgets to set it for the contained <p> style. However you look at it, this is a bug. That's why the likes of you and I have to patch in a fix, and almost certainly why the original poster has found she/he has got a left margin in the table cells that wasn't asked for.
The point I'm making is that you do have to do something to fix the bug. I'll willingly admit that your and Dave's suggested fixes are cleaner and better than mine for lots of reasons. I'll be replacing my bodge with your better bodge soon.
But the fact is that when you set up your tables and define row/column/cell styles, Flare correctly uses your defined styles to set the font, background, text alignment etc for both the <td> element and the contained <p> element, and sets the chosen margin-left setting for the <td> style but forgets to set it for the contained <p> style. However you look at it, this is a bug. That's why the likes of you and I have to patch in a fix, and almost certainly why the original poster has found she/he has got a left margin in the table cells that wasn't asked for.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
Re: Tables Style Sheet and How to Apply Styles
I wouldn't call it a bug, or the solution a bodge - it's fundamentally how CSS works.
You've set a margin-left on your paragraph, so that will be used for paragraphs everywhere; whether they're used inside a table cell (td), list item (li), a div tag, or the main body tag.
So your problem is that you've set this margin, but then realised you don't want actually want it everywhere - like inside tables. The solution we've described shows you how to set up the CSS, so that you can define this style to be different depending on its parent element.
The other solution is simply not to set that margin on the paragraph in the first place. Do you really want a 70pt margin on all paragraphs, or was it just to indent paragraphs from the main body? If so, then don't set any margin-left on the paragraph tag, and instead set up the indent on the body tag using either margin/padding-left.
You've set a margin-left on your paragraph, so that will be used for paragraphs everywhere; whether they're used inside a table cell (td), list item (li), a div tag, or the main body tag.
So your problem is that you've set this margin, but then realised you don't want actually want it everywhere - like inside tables. The solution we've described shows you how to set up the CSS, so that you can define this style to be different depending on its parent element.
The other solution is simply not to set that margin on the paragraph in the first place. Do you really want a 70pt margin on all paragraphs, or was it just to indent paragraphs from the main body? If so, then don't set any margin-left on the paragraph tag, and instead set up the indent on the body tag using either margin/padding-left.
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Tables Style Sheet and How to Apply Styles
Wot Dave sed - it's not a bug it's a feature! 
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx