How to select ALL TABLES in a topic

This forum is for all Flare issues not related to any of the other categories.
Post Reply
normir
Jr. Propeller Head
Posts: 8
Joined: Sun Jun 07, 2015 2:34 am

How to select ALL TABLES in a topic

Post by normir »

Is there any way to select all TABLES (or other elements for that matter) - in my case I have imported a document with 20 or 30 tables. I have defined a table style and I would like to "apply" that style to all of my tables - without selecting each one and setting the style.

I see that all of the tables "came in" from word (via the wizard) with NO style just a <table> tag. After I have selected a table and set the style I see that FLARE has cleverly added lots of xml to not just the <table> tag but all of the <th>, <tr> and <td> tags - so I do not see an easy of doing a find/replace.

Of course, if I already had a style I can see how find/replace would work but ... in my case, not so sure ?

As I have another 30 or so files to import (with lots more tables) I am trying to find the easiest solution.

I have control over the WORD content and could attempt to make some changes in there before conversion if that would make sense.

Thoughts/opinions/solutions ?

Thanks
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: How to select ALL TABLES in a topic

Post by Paulie »

Hi there,

We have a script that applies a table style to each table after the Word document has been imported. This is a two-stage process, and you should be able to use a find and replace tool (or even Flare's find and replace) to do something similar.

Depending on your document import settings this may not work as expected. For example, I can foresee issues if you are preserving your Word styles. Remember, back up your content if you have already made changes (I'd suggest doing this on a recently imported document where you haven't fixed up the tables yet).

Perform the following find and replace operations on all of your html pages in the folder containing your exported html files (typically <projectname>\content\<Word or ImportFileName>):

Step One:

Search for <head> and replace it with the following:
<head><link href="../Resources/TableStyles/<YourTableStyleSheet>.css "rel="stylesheet" MadCap:stylesheetType="table"/>

This adds a reference to your table style sheet to each html page.

Step Two:
Search for <table and replace all instances with the following:
<table style="mc-table-style: url('../Resources/TableStyles/<YourTableStyleSheet>.css');" class="TableStyle-YourTableStyleSheet"

This updates each table to use the Flare table style sheet.

This should be enough for Flare to detect and apply the table style when content is built. Note that when you open a topic in Flare, it will fully apply the table styles to the page. If you close the topic without making any changes, Flare will still prompt you to save these changes even though it appears that you haven't made any changes. This is normal, although it can be disconcerting if you are not expecting it.
Last edited by Paulie on Mon Jun 08, 2015 1:30 pm, edited 2 times in total.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
normir
Jr. Propeller Head
Posts: 8
Joined: Sun Jun 07, 2015 2:34 am

Re: How to select ALL TABLES in a topic

Post by normir »

Very nice !!

You filled in exactly the piece that I was missing (and presumed would be a problem) - FLARE takes care of applying the style to the individual TR, TD elements etc by just putting the style in the <table> element.

Excellent - I did this in one file and it worked perfectly.

b.t.w. It is enough to just move from the XML Editor tab to the Text Editor tab and back again and the FLARE magic has taken place.

Thanks a lot.
Post Reply