Tables and mediums

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Ineffable
Sr. Propeller Head
Posts: 152
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Tables and mediums

Post by Ineffable »

I am trying to figure out how to link mediums and table stylesheets.

When I open a table stylesheet, I cannot select a medium--the toolbar doesn't provide the dropdowns like the ones in the standard stylesheet editor.

The next thing I tried to do is edit the actual table tag (th, td, tr, etc.) in the standard stylesheet. However, the styles used in the table rows, header, columns, etc., don't exist in the stylesheet. As an example, instead of

Code: Select all

td
I have

Code: Select all

td.TableStyle_Tools_Body_0_0_RowSep_ColEnd
. When I click 'Edit Style' in the Styles window, it transports me to the stylesheet but none of the styles are selected because nothing matches.

So, how do I apply mediums to tables?

Thanks!
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

Re: Tables and mediums

Post by techwriter31 »

Kellie
Ineffable
Sr. Propeller Head
Posts: 152
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Tables and mediums

Post by Ineffable »

techwriter31 wrote:This might help:
http://webhelp.madcapsoftware.com/flare ... Output.htm
Sorry, I should have added one more detail: The outputs I'm working with are WebHelp and WebHelp Mobile, neither of which are Print outputs. Does that make things more difficult?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Tables and mediums

Post by LTinker68 »

I believe you can only create a print medium version of the table stylesheet and if I recall correctly there is a bug where it only looks in the medium called "print" -- it doesn't allow you to specify a different or custom medium.

Submit a feature request at http://www.madcapsoftware.com/bugs/submit.aspx asking for the ability to be able to create table styles for mediums other than print, including mobile output.

In the meantime, I recommend you create two tables in one topic or two topics with one table each, and apply a conditional tag to each table or topic to specify which is used for online and which is used for mobile. For the mobile table, I'd use the standard table tags in the main topic stylesheet or create custom table tags, but specify sizes and styles appropriate for mobile devices. Or don't use table stylesheets at all and use the default medium and mobile medium (or whatever you called it) in the main topic stylesheet to distinguish how the styles appear in the two different outputs. I'd probably go with that second option, actually.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Ineffable
Sr. Propeller Head
Posts: 152
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Tables and mediums

Post by Ineffable »

LTinker68 wrote:I believe you can only create a print medium version of the table stylesheet and if I recall correctly there is a bug where it only looks in the medium called "print" -- it doesn't allow you to specify a different or custom medium.

Submit a feature request at http://www.madcapsoftware.com/bugs/submit.aspx asking for the ability to be able to create table styles for mediums other than print, including mobile output.

In the meantime, I recommend you create two tables in one topic or two topics with one table each, and apply a conditional tag to each table or topic to specify which is used for online and which is used for mobile. For the mobile table, I'd use the standard table tags in the main topic stylesheet or create custom table tags, but specify sizes and styles appropriate for mobile devices. Or don't use table stylesheets at all and use the default medium and mobile medium (or whatever you called it) in the main topic stylesheet to distinguish how the styles appear in the two different outputs. I'd probably go with that second option, actually.
The second option that you mention is the one I am trying to implement.

However, for some reason the tags in the table cells don't correspond to a tag in the main topic stylesheet. When I place the cursor in the cell I wish to edit, the current style for the text in the cell is th.TableStyle_Tools_Head_0_0_RowSep_ColEnd. When I click 'Edit Style', it doesn't correspond to an existing tag. It should tie in to the th tag in the stylesheet, but it doesn't. If I edit the th tag, the changes don't appear in the table. It's as if the table text has overrides.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Tables and mediums

Post by NorthEast »

Ineffable wrote:However, for some reason the tags in the table cells don't correspond to a tag in the main topic stylesheet. When I place the cursor in the cell I wish to edit, the current style for the text in the cell is th.TableStyle_Tools_Head_0_0_RowSep_ColEnd. When I click 'Edit Style', it doesn't correspond to an existing tag. It should tie in to the th tag in the stylesheet, but it doesn't. If I edit the th tag, the changes don't appear in the table. It's as if the table text has overrides.
That's because those classes are defined in the table stylesheet - not your main stylesheet.

When you create a table in the editor, Flare generates a table stylesheet with the formatting for the th/td classes (have a look at in the text editor). When you assign a table style to a table, Flare links the table to the table stylesheet and applies the appropriate th/td classes to the table cells - which is what you are seeing.

LTinker's solution is not to use table stylesheets at all, i.e. don't apply a table style to the table. Instead create your own table/th/td styles in your main stylesheet (in the appropriate mediums), and apply those to your table manually.
Ineffable
Sr. Propeller Head
Posts: 152
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Tables and mediums

Post by Ineffable »

Dave Lee wrote:
Ineffable wrote:However, for some reason the tags in the table cells don't correspond to a tag in the main topic stylesheet. When I place the cursor in the cell I wish to edit, the current style for the text in the cell is th.TableStyle_Tools_Head_0_0_RowSep_ColEnd. When I click 'Edit Style', it doesn't correspond to an existing tag. It should tie in to the th tag in the stylesheet, but it doesn't. If I edit the th tag, the changes don't appear in the table. It's as if the table text has overrides.
That's because those classes are defined in the table stylesheet - not your main stylesheet.

When you create a table in the editor, Flare generates a table stylesheet with the formatting for the th/td classes (have a look at in the text editor). When you assign a table style to a table, Flare links the table to the table stylesheet and applies the appropriate th/td classes to the table cells - which is what you are seeing.

LTinker's solution is not to use table stylesheets at all, i.e. don't apply a table style to the table. Instead create your own table/th/td styles in your main stylesheet (in the appropriate mediums), and apply those to your table manually.
Does this mean I have to go to every table (I've about a hundred) and manually remove the table stylesheet from them and then re-apply the styles from the main stylesheet?
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Tables and mediums

Post by Nita Beck »

Ineffable wrote:Does this mean I have to go to every table (I've about a hundred) and manually remove the table stylesheet from them and then re-apply the styles from the main stylesheet?
Yes, but you can probably do some clever (and careful) search-and-replaces in your topics' source code to swap out the styles from the table stylesheet for the styles in the main stylesheet. BACK UP your project first. Then try a few experiments until you're happy with the replace routines you figure out.

BTW, this kind of stuff is exactly why I (and many of the members of the Rochester Flare User Group [with shout out to Brian Laing!]) heartily recommend using FAR HTML. Until MadCap gives us a more sophisticated search-and-replace feature, FAR HTML is far superior (no pun intended), and it's not terribly expensive. We wouldn't author in Flare without it.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Ineffable
Sr. Propeller Head
Posts: 152
Joined: Mon Jan 15, 2007 3:08 pm
Location: Bay Area, CA

Re: Tables and mediums

Post by Ineffable »

Nita Beck wrote:
Ineffable wrote:Does this mean I have to go to every table (I've about a hundred) and manually remove the table stylesheet from them and then re-apply the styles from the main stylesheet?
Yes, but you can probably do some clever (and careful) search-and-replaces in your topics' source code to swap out the styles from the table stylesheet for the styles in the main stylesheet. BACK UP your project first. Then try a few experiments until you're happy with the replace routines you figure out.

BTW, this kind of stuff is exactly why I (and many of the members of the Rochester Flare User Group [with shout out to Brian Laing!]) heartily recommend using FAR HTML. Until MadCap gives us a more sophisticated search-and-replace feature, FAR HTML is far superior (no pun intended), and it's not terribly expensive. We wouldn't author in Flare without it.
Ugh.

Wouldn't this all be moot if the medium dropdown was also available on the table stylesheet?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Tables and mediums

Post by LTinker68 »

Ineffable wrote:Wouldn't this all be moot if the medium dropdown was also available on the table stylesheet?
Hey, it took them until, what, v4 to add the ability to specify a print version of a table stylesheet?

It would simplify things if there were medium drop-downs in the table stylesheet and it wasn't restricted only to a print medium called "print". Make sure you submit a feature request at http://www.madcapsoftware.com/bugs/submit.aspx.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
livetoski
Sr. Propeller Head
Posts: 135
Joined: Thu Aug 30, 2007 7:10 am
Location: Ottawa

Re: Tables and mediums

Post by livetoski »

Okay, I am pretty naive so this might be obviously wrong to someone who codes on a regular basis. As far as I can see, you don't have to apply a style to each table.

I did exactly that to start, I created a p.cellbody tag because every time you press enter in a table cell, it creates a p tag. (maybe there is a way around that...). So then every time I created a table, for each cell I hit enter and applied the p.cellbody tag. I was pretty grumpy about this.

So I thought I'd just find that td and give it the same values as the p.cellbody. So I opened the style sheet in one of the text editors we use, Edit Pad Pro or Edit Plus, and copied the formatting for the p.cellbody to the td in my default medium. That appears to be that. All the cells in every table now start with the formatting that I wanted them to have in the first place. If I want my printed tables to differ, I'd just change the td in the print medium. If I want something to appear differently in a cell, I use local formatting. Anyway, after you click enter, you are screwed, basically, as you have to apply a tag of some sort. Other than importing (which I rarely do) I don't know of any way of auto populating tables.

Tell me if I am going to regret this.
livetoski
Sr. Propeller Head
Posts: 135
Joined: Thu Aug 30, 2007 7:10 am
Location: Ottawa

Re: Tables and mediums

Post by livetoski »

to be clear, when I create a table now (not sure about importing) it picks up the td style that I have formatted in the css. I didn't create a subclass.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Tables and mediums

Post by LTinker68 »

livetoski wrote:As far as I can see, you don't have to apply a style to each table... Tell me if I am going to regret this.
Your process is perfectly fine if you're not using table stylesheets but are just using the main topic stylesheet. It's when you're using table stylesheets that things can get more complicated.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
livetoski
Sr. Propeller Head
Posts: 135
Joined: Thu Aug 30, 2007 7:10 am
Location: Ottawa

Re: Tables and mediums

Post by livetoski »

But I am using table style sheets. That's the thing, my table now comes in from the style sheet and the td class is now formatted exactly the way I want it, until I click enter in the cell. After I click enter in the cell, I have to apply the p.cellbody style, and everything looks the same. Also, when it comes to copying and pasting, it's easier now to leave as the tdtablestyle, and copy because the editor does pop up with a choice for style.
livetoski
Sr. Propeller Head
Posts: 135
Joined: Thu Aug 30, 2007 7:10 am
Location: Ottawa

Re: Tables and mediums

Post by livetoski »

to be clear, I am formatting the cell through the css and the table through the table style. Not the table style itself. But the tables from the table style now enter my topics with the formatting within the cells at least that I prefer. This is not the original problem, but something that has plagued me. Is there an override?
1. How do table styles and css interact?
2. Will all tables inherit a table style defined in the css and then have to be individually re-applied?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Tables and mediums

Post by LTinker68 »

livetoski wrote:1. How do table styles and css interact?
You make them sound like two different things, and they're not. They're both cascading stylesheets. It's just that when you create a table stylesheet, Flare automatically puts all its styles in a new stylesheet instead of putting them in the main topic stylesheet.

Basically, the style definition that's closest to the content (code-wise) wins. So an inline style in a span tag will override styles defined in its parent paragraph tag, and the style definition for the paragraph tag will override the style definition of its parent tag (e.g., the body tag). Most style definitions are made in stylesheets. Stylesheets are referenced at the top of the topic's page code, and the same rule of precedence applies. Whichever style definitions are in the last stylesheet defined will override the style definitions of the stylesheet declared previously, BUT ONLY if the styles are in conflict. Or to be more precise, the attributes. So if styles2.css is declared (referenced) after styles1.css, and styles2.css has the base paragraph tag set to display text as bold and styles1.css has the base paragraph tag set to display text as italic, then the content in the topic will be bold AND italic, because the font-weight attribute in styles2.css is not in conflict with the font-style attribute in styles1.css, even though both attributes are defined in the base paragraph tag in each stylesheet. If, however, the base paragraph tag in styles1.css was set to have a font-weight set to normal, then the font-weight declaration of bold in styles2.css would prevail, because styles2.css was called after styles1.css.

Likewise, Flare usually lists (declares) table stylesheets after the main topic stylesheet which is listed after the MadCap.css stylesheet that Flare adds when it builds the output. So in your situation, if you were to set your base <td> tag in the main topic stylesheet to display text in a red font but you set the table stylesheet to display content in a blue font, then the tables would appear in a blue font, because the table stylesheet is declared last so its font color value defined on the base <td> tag wins over the font color value you defined for the base <td> tag in the main topic stylesheet.

livetoski wrote:2. Will all tables inherit a table style defined in the css and then have to be individually re-applied?
Not sure what you mean by that. When you create a table, you have the option to let it use the default styles (pulled from the main topic stylesheet) or to use an existing or new table stylesheet.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply