Table STYLES vs Table Classes

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
ktbCA57
Sr. Propeller Head
Posts: 483
Joined: Wed Feb 04, 2009 7:45 am

Table STYLES vs Table Classes

Post by ktbCA57 »

so... i'm having trouble distinguishing between the two.. i have created table style(Sheets), but then i go into edit the look of a table... and i'm not sure whether to make the changes in the Table CLASS or Table STYLES.... which does what...

many times i go into make changes and they either get applied to everything or not the right things...

thanks.

BTW.. i have been checking Flare online help each time before i post a topic.. this time included.. but could not get a clear picture of the difference. Believe it or not, i HAVE found a few of my answers there.. but just not enough apparently.
forfear
Propellus Maximus
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: Table STYLES vs Table Classes

Post by forfear »

ktbCA57 wrote:many times i go into make changes and they either get applied to everything or not the right things...
thanks.

The best way, is to NOT open it in the stylesheet editor. but to define it in the Table StyleSheet Editor.
If you haven't done so, you add a Table Stylesheet.
Project > Add Table Style

to define or tweak a table style
with the table selected, right-click and select one of the following:
Table Properties.
or
Table Style > Edit Style.

and you'll be on to a good start in life.

don't touch the Table stylesheets manually. its not worth the trouble.


FYI, IMHO, Flare's table styles editor was among the industry's best in the Help authoring space when it first came out,a few years ago, (v3?). This has since been emulated quite a bit every where now here and there. no kidding. but this has since been buried under the weight of other new features.

your initial troubles are understable though.

ktbCA57, here's some big help and tips for ya
watch the Table related videos here, this should put you in the right path....
http://www.madcapsoftware.com/demos/support.aspx
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
GregStenhouse
Sr. Propeller Head
Posts: 330
Joined: Tue May 13, 2008 3:27 pm
Location: Christchurch, New Zealand

Re: Table STYLES vs Table Classes

Post by GregStenhouse »

Have a look at the "Flare Tables and Styles" demo put out by tech support
https://www.madcapsoftware.com/demos/support.aspx

Note: if you are having problems viewing this, install the GoToMeeting codec http://www.gotomeeting.com/codec

Cheers
Greg
jbean
Propeller Head
Posts: 44
Joined: Wed Aug 29, 2007 8:07 am
Location: Cape Cod

Re: Table STYLES vs Table Classes

Post by jbean »

i installed the codec and i still get an error when i click the link and media player opens. will try rebooting.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

I also cannot get those video demos to play. I tried on both my PC using the latest version of Windows Media Player with the GoToMeeting Codec installed, as well as on a Mac using the latest version of Flip4Mac, and both failed. Has anyone gotten these to run properly?

On the PC, I get error message C00D11D2, and on the Mac, I get an unresolved reference error. Inside of the FlareTables.wvx file, it has a line with an HREF pointing to "FlareTables.wmv", but it can't seem to access the file.

Any help is greatly appreciated, as I'm having a bear of a time understanding how to find the simplest way to format tables consistently and easily. I did one table using just the standard table tags (<th>, <td>, etc.) without using the Table Stylesheet at all, but I thought the Table Stylesheet would be quite handy if only it worked as I thought it would.
cbdebris
Sr. Propeller Head
Posts: 105
Joined: Wed Aug 15, 2007 4:15 pm
Location: California

Re: Table STYLES vs Table Classes

Post by cbdebris »

Here's the pieces of the one we use ... we do not have a separate stylesheet for tables. Maybe you can reverse-engineer from this code.

Code: Select all

table
{
	letter-spacing: 0px;
	font-family: sans-serif, 'Lucida Sans', Arial;
	line-height: 124%;
	margin-bottom: .75em;
	margin-top: .5em;
	font-size: 100%;
	mc-auto-number-format: '{ }{ }{ }{ }';
	border-spacing: 0;
	border-collapse: collapse;
}

tbody
{
	font-family: sans-serif, 'Lucida Sans', Arial;
	line-height: 124%;
	padding: 0em;
	font-size: 100%;
}

thead
{
	font-family: sans-serif, 'Lucida Sans', Arial;
	font-weight: bolder;
	color: #ffffff;
	background-color: #c9c9c9;
}

th.table-title,
th.table-title-small
{
	font-variant: normal;
	font-weight: bold;
	padding: 0.2em;
	background-color: #84a4d5;
	color: #ffffff;
	background-color: #bbbbbb;
	border-bottom-color: #acacac;
	border-right-width: 2px;
	border-bottom-width: 0px;
	border-right-color: #ffffff;
	border-right: solid 2px;
	border-bottom: solid 0px;
	page-break-after: avoid;
}

p.table-text,
p.table-text-small
{
	letter-spacing: 0px;
	font-size: 100%;
}

td
{
	vertical-align: top;
	padding: 0em;
}

tr
{
	padding: 0em;
}

tr.Even
{
	
}

tr.Odd
{
	background-color: #eaeaea;
}

table.TwoColumn
{
	border-bottom: solid 1px;
	letter-spacing: 0px;
	font-family: sans-serif, 'Lucida Sans', Arial;
	line-height: 124%;
	margin-bottom: .75em;
	margin-top: .5em;
	font-size: 100%;
	mc-auto-number-format: '{ }{ }{ }{ }';
	vertical-align: top;
	border-bottom-color: #c9c9c9;
	table-layout: auto;
}

table.TwoColumn td
{
	padding: .3em;
}

td.border
{
	border-right: solid 1px;
	border-right-color: #b7b7b7;
}

th.table-title
{
	vertical-align: bottom;
}

All life is a blur of Republicans and meat. -- Zippy the Pinhead
forfear
Propellus Maximus
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: Table STYLES vs Table Classes

Post by forfear »

Rona Kwestel wrote: Any help is greatly appreciated, as I'm having a bear of a time understanding how to find the simplest way to format tables consistently and easily. I did one table using just the standard table tags (<th>, <td>, etc.) without using the Table Stylesheet at all, but I thought the Table Stylesheet would be quite handy if only it worked as I thought it would.

If the videos don't work let's see if i can write a simplified version with some quick results you can see to get you started, enough to motivate you, to gently dive into Flare's dense help topics on Tables.


In Flare, click Project > Add Table Style.
In Templates, select Basic.
Name it MyFirstTable.

In General tab, set Cell Padding to 2px (click the arrow beside the four boxes, to set all top, left, right, bottom, all at once.

In the rows tab,
in Separator, set the color to a light grey.
In Background, set the colour to pink.
In Patterns, click Add. (you should have this row selected, Pattern 2,repeat =1)
In Background, set the colour to white.
in Separator, set the color to a light grey.

In the Header tab,
In text, set the fore-color to pink.
Press CTRL+S to save and close the Table Style editor.


Open a topic, insert a Table.
In Table Size, set header rows to 1.
In Table Style, select MyFirstTable.
click Ok.


In the XML Editor, when you are typing or working with the table, enable the following toggles Show Table Columns and Show Table Rows.
66 Capture.png
67.png


How to Edit the table style again
When in a table, right-click and select Table Properties.
Save the Table Style. See Content Explorer | Resources > TableStyles
You do not have the required permissions to view the files attached to this post.
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
forfear
Propellus Maximus
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: Table STYLES vs Table Classes

Post by forfear »

Also,
Avoid editing the TableStyle generated stylesheet with notepad,dreamweaver or text editor unless you're feeling a bit of a need for some challenge in life.

Flare's built-in TableStyle editor is pretty much the best there is, at this point in time for an XML/CSS tool or for a HATT.
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

Thanks, all, for your additional help.

I managed to create a TableStyle to my satisfaction, and it's working fine in most cases.

However, I have occasions where I need to color-code some text to categorize it within a table, and match those same colors to text outside the table that describes the categories. So, I have created classes of the form span.ColorCode_Blue and td.ColorCode_Blue for a variety of colors. I apply the span classes to the text describing the categories, and the td classes to the cells in the table that correspond to the respective categories, as it seems that Flare does not allow you to apply a span class to selected text inside of a table cell.

The problem is that after I assign all these td classes to the various cells in the table, if I add or delete a row or column, all of the td styles get removed and I have to re-apply them all over again.

Here is a picture of the table before I insert a column:
before.gif
And after I insert a column:
after.gif
Why is this happening, and how can I work around it without having to remember and re-assign all the td styles?

Of course, I can edit the html code directly, but this seems like a bug to me, no?
You do not have the required permissions to view the files attached to this post.
Last edited by Rona Kwestel on Wed Jun 10, 2009 11:32 am, edited 1 time in total.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table STYLES vs Table Classes

Post by LTinker68 »

That's one of the downsides to using table stylesheets.

One way to get around it is to put the text in the table cells into paragraph tags, and then apply your span style to the text. If you have padding and other attributes on your paragraph tag that you don't want to be carried into a table, then create a complex selector (in the main topic stylesheet). For instance, the simplified code below shows the base paragraph tag having a margin-bottom of 8px but when a paragraph is inside a table, it's margin-bottom is 0, as specified in the complex selector.

Code: Select all

p {
    margin-bottom: 8px;
}

td p {
    margin-bottom: 0;
}
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

The problem with the embedded p tags is that then you're back to the problem of not being able to select the full text string at once to apply the span style, since selecting the entire paragraph's worth of text removes the span styles from the available list.

I don't understand why my issue is considered a "downside to using table stylesheets" rather than a bona fide bug. Is there any real reason why this can't work as I would expect? Same goes for copying text from one cell to another - it loses the td class.

These kinds of usability issues really diminish the experience of using Flare.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table STYLES vs Table Classes

Post by LTinker68 »

Rona Kwestel wrote:The problem with the embedded p tags is that then you're back to the problem of not being able to select the full text string at once to apply the span style, since selecting the entire paragraph's worth of text removes the span styles from the available list.
If you create the class as a generic class instead of a span class then you'll see the class available no matter what you have selected, because you can apply it to any tag (so long as the attributes specified in the generic class are supported by the type of tag you're applying it to). A generic class begins with a period (.redText) instead of being specific to the span tag (span.redText). Or you could create three new paragraph classes and apply the appropriate paragraph class to that paragraph instead of trying to apply a span to it.
Rona Kwestel wrote:I don't understand why my issue is considered a "downside to using table stylesheets" rather than a bona fide bug. Is there any real reason why this can't work as I would expect? Same goes for copying text from one cell to another - it loses the td class.
Yeah, I kinda sorta agree with that, but kinda sorta don't. The table stylesheet is strictly going by row count (even/odd rows or every third row, etc., depending on what you set up) or column count, so every time you add a row or column, you're adjusting the number of rows/columns which causes it to recalculate (reapply) the row classes. Can Flare be made smarter about that? Can it realize that you're adding a row to the end so the whole table doesn't have to be redrawn? I don't know, I'm not a programmer. I don't know if it's a drawback of that type of CSS "automation" of styles that locks you into that behavior or if it's how MadCap implemented that functionality.

Here's an example. Say you're alternating row background colors like so...

row 1, odd row color bkg (white)
row 2, even row color bkg (blue)
row 3, odd row color bkg (white)
row 4, even row color bkg (blue)
row 5, odd row color bkg (white)

If you apply a class to row #3 that turns that background color to red, then add a row to the end of the table, then it seems like row #3 could stay red (still an odd row with a class applied to it), and row #6 would be an even row so it would be blue. But, if you were to insert a new row between rows 2 and 3, then the whole table has to be redrawn because what was row 3 is now row 4 so it's now an even row instead of an odd row, so it redraws the table and your manually-applied td class is overwritten by the correct alternating color. The reason I recommended putting the text into a paragraph and applying a span to the paragraph is because the table content isn't modified, only the td classes are.

BTW, just to give you a head's up, you'll have a lot more problems if you ever try to merge cells and you're using a table stylesheet with alternating row or column colors.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

Thanks for the tip about the generic class. I'm still learning CSS as I go along, so I'm not always aware of all the options.

I can see your point about the alternating rows/columns, with that styling applied at the table row/column level, but it still seems to me that if additional styling was applied on top of the "base" styling of the alternating rows/columns, that it could be preserved and reapplied once the rows/columns are recalculated. However, it's admittedly more complicated than just throwing it all out and recalculating anew.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

I'm having a bit of an odd problem with the generic classes. I defined the following in my .css file:

Code: Select all

.colorCode_Blue
{
	color: ##3300ff;
}

.colorCode_Green
{
	color: #339900;
}

.colorCode_Orange
{
	color: #ff3300;
}
When I click in a td cell, I see the generic styles shown in their respective colors in the Styles pane:
tablerow.gif
But if I press Enter inside a cell to insert a <p> tag, the .colorCode_Blue style appears black:
paragraph.gif
I tried moving the location of the generic classes from the top of the file to the bottom, thinking that maybe there is some required order to what's defined in the file, but it didn't change anything. I still have the td.ColorCode and span.ColorCode styles defined as well.

Any clue why this is happening?
You do not have the required permissions to view the files attached to this post.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table STYLES vs Table Classes

Post by LTinker68 »

That could just be a bug with the Styles pane. When you apply the generic class to the <p> tag, does the text appear blue like it's supposed to? BTW, you might also want to open the topic in the Internal Text Editor and delete any inline styles in your text that might have been held over from your previous attempts to get the span to work and such. Inline styles will override the style in the class.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

No, as you can see in the screenshots, the text to which the "blue" style was applied appeared black as well. No matter what I did, I could not get that to work as long as it was inside a <p> tag.

Not only that, but when I tried building the help output, the td.ColorCode styles didn't work either. Even though they appeared correctly in the editor, the output was all black.

So, I went back to removing the <p> tags and simply applying the span.ColorCode styles, and did the annoying trick of applying it to the full span just short of the last letter (to avoid landing in <p> territory), and then inserting the missing letters inside the span and deleting the letters outside the span. This seems to work, both in the sense that I can insert/delete rows/columns without losing my color coding, and that the colors appear as expected when building the project.

All in all, that was a lot of work for a small detail. And something was definitely buggy in the way these styles were rendering in the Styles pane and the editor.
Last edited by Rona Kwestel on Thu Jun 11, 2009 1:58 pm, edited 1 time in total.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table STYLES vs Table Classes

Post by LTinker68 »

Make sure you submit a bug report at http://www.madcapsoftware.com/bugs/submit.aspx.

I don't use the table stylesheets except for very simple tables that don't require any special modifications to the text or layout. If a table does require some modification to the text or layout, then I use standard table tags (table, tr, th, td) in the main topic stylesheet and build the table appearance manually. Takes a bit longer but it's more flexible with the design.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Table STYLES vs Table Classes

Post by NorthEast »

I just read this post and I'm not sure I get exactly what's going on, but had a few comments:

If you're using table stylesheets, then don't apply classes to cells (td) as they already have a set class (visible in the style pane or toolbar). Flare's table stylesheet formatting works by generating it's own set of cell (td) classes, which are applied to the table when you create it, and are re-applied every time you modify the table. If you apply your own class to a cell (td), then you can temporarily change the original class, but it'll revert back as soon as you edit the table.

Pressing enter in a table cell will insert a paragraph tag, so the text will use the formatting you've set for your p tag (and the p tag won't inherit the td class). So although you might've set the cell to have coloured text, your paragraph style may use black text.

Applying a span class to a full paragraph is a pain, I usually add a space to end before I apply the span.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

Dave Lee wrote:
If you're using table stylesheets, then don't apply classes to cells (td) as they already have a set class (visible in the style pane or toolbar). Flare's table stylesheet formatting works by generating it's own set of cell (td) classes, which are applied to the table when you create it, and are re-applied every time you modify the table. If you apply your own class to a cell (td), then you can temporarily change the original class, but it'll revert back as soon as you edit the table.
Okay, got it. I guess that makes sense, but it wasn't initially clear to me, and caught me by surprise.

Dave Lee wrote:
Pressing enter in a table cell will insert a paragraph tag, so the text will use the formatting you've set for your p tag (and the p tag won't inherit the td class). So although you might've set the cell to have coloured text, your paragraph style may use black text.
Since my text in this case is only one line, I opted to omit the <p> tag, applying the span directly to the text inside the <td> tag without the <p> tag, and it seems to work okay.

What I couldn't get to work was using the generic class with the <p> tag, which Lisa had suggested as a way for getting around the annoying span issue. For some reason, once the cursor was inside the <p> tag, the generic class that was meant to be blue text appeared as black, both in the Styles pane and when applied to the text, and I could not figure out why. So, I was back to the dreaded span.

Dave Lee wrote: Applying a span class to a full paragraph is a pain, I usually add a space to end before I apply the span.
Yes, a pain indeed. They really should provide a simpler mechanism for doing this without having to jump through hoops.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Table STYLES vs Table Classes

Post by NorthEast »

Rona Kwestel wrote:What I couldn't get to work was using the generic class with the <p> tag, which Lisa had suggested as a way for getting around the annoying span issue. For some reason, once the cursor was inside the <p> tag, the generic class that was meant to be blue text appeared as black, both in the Styles pane and when applied to the text, and I could not figure out why. So, I was back to the dreaded span.
Ok, I thought maybe you'd applied the generic class to the td cell before pressing enter and creating the paragraph tag, as in that situation the paragraph wouldn't be set to use the generic class.

I don't understand why the generic class doesn't work when applied to the paragraph tag, does it work ok if you apply it to paragraphs that are outside of the table?

Also, the Flare editor and the style picker aren't perfect in displaying styles, sometimes styles may appear incorrect in the editor but are actually fine when you view the output in a browser. Do your styles appear ok in the browser or not?
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Table STYLES vs Table Classes

Post by Rona Kwestel »

Dave Lee wrote: I don't understand why the generic class doesn't work when applied to the paragraph tag, does it work ok if you apply it to paragraphs that are outside of the table?
Well, call me crazy, but I swear this wasn't working when I first tried it, and now it is. Mind you, I had deleted the generic classes after failing to get them to work, and just now re-created them to definitively answer your questions, and Flare was stopped and restarted in between, so perhaps there was some flaky behavior going on and it's now cleared up. I can't really explain it, but I endured all that span pain for nothing.
Post Reply