Using custom <td> with mcTableStyle

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
ddiemetric
Propeller Head
Posts: 59
Joined: Mon Nov 24, 2008 12:31 pm
Location: Is it Spring yet?

Using custom <td> with mcTableStyle

Post by ddiemetric »

Hi.
I have some tables in which I want to indent certain content in the table cells. I know I can do this using paragraph styles, but I would prefer not to. There will be up to a dozen indent levels and I don't want to add that many paragraph classes to the style sheet. I also don't want to create the “effect of” indents using multiple table cells (that would be a maintenance nightmare with tables of this size). I would prefer to use <td> classes to apply the indentation (using padding) that can be applied like a style to a table cell.
Our table styles have been set up using the Flare Tablestyle Editor. Unfortunately, the editor creates tables based on mcTableStyle, not a regular <table> tag, and uses MadCap row and column definitions like ".TableStyle-Basic-BodyI-Column1-Row" so basic custom <td> classes won't inherit the styles specified for the table. Does anyone know of a way to create a custom <td> tag that will work with the MadCap table structures and can be applied like a style to a table cell?
Thanks in advance.
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: Using custom <td> with mcTableStyle

Post by SteveS »

If you select a cell in the table and right click the 'block' on the left of the XML editor you can select Style Class from the context menu.

From here you can create a style class with the formatting you need. This can then be appiled using the same right click, except you select the class from the context menu, rather than create a new one.

HTH.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Using custom <td> with mcTableStyle

Post by NorthEast »

ddiemetric wrote:Does anyone know of a way to create a custom <td> tag that will work with the MadCap table structures and can be applied like a style to a table cell?
Unfortunately not - as you've found, you can't apply classes to td (or th and tr) tags if the table uses a table stylesheet.
If you do, the class will simply be overwritten if you edit the table.
Flare's table styles do allow you to apply styles to individual rows and columns (using a custom type, instead of the fixed pattern type), but you can't set up styles for individual cells.

If this is just to handle indents, and you don't want paragraph classes, there's probably two options:

a) Set up div classes (e.g. div.indent1 to div.indent10 or whatever), and select these using the indent icon on the toolbar.

b) Create a bullet list style (ul) that doesn't display a bullet; e.g.

Code: Select all

ul.indent
{
	list-style-type: none;
}

ul.indent li
{

}
(Add your margin/padding to the ul and li styles)
ddiemetric
Propeller Head
Posts: 59
Joined: Mon Nov 24, 2008 12:31 pm
Location: Is it Spring yet?

Re: Using custom <td> with mcTableStyle

Post by ddiemetric »

Thanks for the suggestions. Appreciate it. I think I'll go log an enhancement request.
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: Using custom <td> with mcTableStyle

Post by SteveS »

Dave Lee wrote:
ddiemetric wrote:Does anyone know of a way to create a custom <td> tag that will work with the MadCap table structures and can be applied like a style to a table cell?
Unfortunately not - as you've found, you can't apply classes to td (or th and tr) tags if the table uses a table stylesheet.
If you do, the class will simply be overwritten if you edit the table.
Flare's table styles do allow you to apply styles to individual rows and columns (using a custom type, instead of the fixed pattern type), but you can't set up styles for individual cells.
I didn't try it on a Flare maintained table, as you say Flare fights to keep its styles.

It does work if you are prepared to hard code tables, but that's a decision to make at the beginning of a project. I'd hate to go back through a large project redoing all the tables! :)
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Post Reply