TableStyle is being reset by table "class"

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
mattf
Sr. Propeller Head
Posts: 277
Joined: Thu Feb 09, 2006 5:35 pm
Location: Next to the window

TableStyle is being reset by table "class"

Post by mattf »

In creating a master project, I brought a bunch of TableStyles together from various projects and put them in the TableStyles folder. To compare the styles so I could see what I had, I created a bunch of identical little tables on one topic page and then styled each one to one of the TableStyles. I did this by clicking the "table" bar next to each one and then choosing TableStyle from the context menu. As I changed the style of the third one, the previous one also suddenly changed, and as I went along adding a style to each one, the ones above were all changed in little ways. They didn't all end up being the same, but almost all got changed as I went down the page.

I got into the internal text editor and changed the <table style> tags back so that each one said the name of that particular style, but while there I noticed the class="" attribute, which is I believe wehre the problem is. If it were just a matter of setting <table style="mc-table-style: url('Resources/TableStyles/buttonsTable.css');"> I think there would be no problem. But the class attribute kept assigning itself class="Basic", even after I removed the value and saved the file with class="". Then I tried putting the TableStyle name in the class attribute, and that worked briefly for two of the styles but not for others, and then even those reverted.

Frankly, I can't even properly retrace all the weird things that happened and when each thing happened. What I need is for someone to explain to me in simple terms the relationship between the TableStyle and the class. It looks to me as though the class is overriding the TableStyle, but why would it? I wasn't even bothering the class value. Does the class info come from my basic stylesheet, the one in the Stylesheets folder? Is there a tutorial or some easy way to understand how this all works? A webinar? A book?

Thanks for any help anyone can give.
Matt F
You learn something new every day if you're not careful.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: TableStyle is being reset by table "class"

Post by LTinker68 »

This is probably a bug in Flare with the way you're assigning the table style. If you assign the table style using the Table Properties screen, then you'd probably be fine. It's in that screen where the "Basic" is probably coming from. So the bug is that selecting the table style from the table block context menu doesn't automatically switch the table's Properties screen from Basic to the selected table style.

That's just a guess, but that's the only place I can think of where "Basic" comes into play.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
mattf
Sr. Propeller Head
Posts: 277
Joined: Thu Feb 09, 2006 5:35 pm
Location: Next to the window

Re: TableStyle is being reset by table "class"

Post by mattf »

Hi Lisa,
Thanks for the reply. I did in fact use the blocks first, so you may be right. But I would have thought that there would have been some way to fix the styles by editing the code. Does there have to be a class? Why doesn't it work to just leave class= empty? I guess what I"m asking is... whether or not there's a bug in that block mechanism, how do I get my TableStyles to stick?

-Matt
Matt F
You learn something new every day if you're not careful.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: TableStyle is being reset by table "class"

Post by LTinker68 »

I think if you select the table styles from the Table Properties screen they'll stick. That said, I've never tried more than one table style in a single topic, so that could also be a problem (bug).

As for the class bit... It seems like Flare used to put the table stylesheet reference at the top of the topic and populated the class in the table tag with the class name from that table stylesheet. I'm either remembering that wrong or they changed things in v7 or v8. If it is a change, then it sounds like they missed a couple of issues when implementing the change. To be honest, I only use table styles occasionally and I don't think I've had more than one table stylesheet in a project, so I've mostly ignored changes to the table styles feature in Flare because I used it so sporadically.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: TableStyle is being reset by table "class"

Post by crdmerge »

No, the class is a Flare-specific reiteration of the style, and should not be blank. For example:

Code: Select all

<table style="mc-table-style: url('Resources/TableStyles/MyTable.css');caption-side: top;margin-left: 0;margin-right: auto;" class="TableStyle-MyTable" cellspacing="0">
Note the correlation between style="mc-table-style: url('Resources/TableStyles/MyTable.css') and class="TableStyle-MyTable"

Good luck,
Leon
mattf
Sr. Propeller Head
Posts: 277
Joined: Thu Feb 09, 2006 5:35 pm
Location: Next to the window

Re: TableStyle is being reset by table "class"

Post by mattf »

Thank you both again for responding. Leon, I think at one point I went through and made each class match its tablestyle URL in the way you're specifying, but they switched back somehow. It's also true that these are all in one topic, which LTink suggests might be throwing a spanner into this. Oh well. Maybe I'll separate this test out into separate pages and see if that makes a difference.
Matt F
You learn something new every day if you're not careful.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: TableStyle is being reset by table "class"

Post by crdmerge »

Do you have a line similar to this in the HEAD section for each and every table style in the topic?

Code: Select all

<link href="Resources/TableStyles/MyTable.css" rel="stylesheet" MadCap:stylesheetType="table" />

Good luck,
Leon
mattf
Sr. Propeller Head
Posts: 277
Joined: Thu Feb 09, 2006 5:35 pm
Location: Next to the window

Re: TableStyle is being reset by table "class"

Post by mattf »

Leon,
I do, but that isn't helping. Here's what's going on now:
I've separated the tables into individual topics, one per topic. For the TableStyle named "buttonsTable.css", I've got the following components:
In the <head> there is this link: <link href="Resources/TableStyles/buttonsTable.css" rel="stylesheet" MadCap:stylesheetType="table" /> Needless to say, this TableStyle has been put in the TableStyle folder.
The <table> tag looks like this: : <table style="width: 100%;mc-table-style: url('Resources/TableStyles/buttonsTable.css');" class="TableStyle_Basic" cellspacing="0"> .

Note that the class is set to "TableStyle_Basic". I don't know where this comes from. I can change it to "TableStyle_buttonsTable" and save it like that, and when I reopen the file in the internal XML Editor it will still say "TableStyle_buttonsTable", but if I open the topic in the regular editor, the value changes immediately and the topic takes an asterisk, indicating the change. If I save it without accepting the change, my value will remain, but in the normal course of things (I open topics, make changes, then save changes and close topic) the value is changed back to "TableStyle_Basic". I have no idea where this value comes from.

Stranger still, consider a different TableStyle in a different topic, this one called "LT_MRR".
In the <head>: <link href="Resources/TableStyles/LT_MRR.css" rel="stylesheet" MadCap:stylesheetType="table" />
The <table> looks like this: <table style="width: 100%;mc-table-style: url('Resources/TableStyles/LT_MRR.css');" class="TableStyle-tableFirstColFixed" cellspacing="0">
In this case, the I can change the class value "TableStyle-tableFirstColFixed" until I'm blue in the face but again, it will always be changed back to this when I open the topic in the WYSIWYG editor. The name comes from yet another TableStyle I have. I don't know why there is a hyphen instead of an underscore in this one.

My suspicion is that Basic and tableFirstColFixed are styles I may have based these newer styles off of, and that that's what the class tag is trying to tell me. Since I don't recall what the styles looked like originally (that's why I was trying to collect and compare them in the first place) I don't really know for sure that the class is actually changing the look of the tables. That only just now occurred to me. So I guess I'm going to not worry about this any more. But if anyone can make the relationship between the table tag and its class attribute less mysterious, I would appreciate it.

Thanks for reading and helping.

Matt
Matt F
You learn something new every day if you're not careful.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: TableStyle is being reset by table "class"

Post by crdmerge »

Looking back at your initial post, I was struck by:
I brought a bunch of TableStyles together from various projects and put them in the TableStyles folder.
Might these be table styles you copied from Flare 7 or older, instead of bringing them in through the Flare conversion process?
Have you looked in the code to see if the words "Basic" or "tableFirstColFixed" appear?
Have you tried creating a few new table styles and running similar multi-tablestyles-in-a-topic testing? The old ones might be corrupted.

That's about it from me. :wink:


Good luck,
Leon
mattf
Sr. Propeller Head
Posts: 277
Joined: Thu Feb 09, 2006 5:35 pm
Location: Next to the window

Re: TableStyle is being reset by table "class"

Post by mattf »

Leon,
Yes, these TableStyles were ALL copied manually from Flare 7 projects. Was in the process just now of creating new styles to test. Thanks for this. I hadn't considered that the files from older projects might be the problem.
Matt F
You learn something new every day if you're not careful.
Post Reply