Cell Content Style in TableStyle Editor

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
mamarachel
Propeller Head
Posts: 39
Joined: Fri Mar 23, 2007 7:27 am

Cell Content Style in TableStyle Editor

Post by mamarachel »

Hi,
I am trying to use the TableStyle Editor to create a table in which the first column body rows contain autonumbered paragraphs. I created a class of <p> with autonumbering on (mc-auto-number-format {n+}.) in the main CSS. Then in the TableStyle Editor on the Columns tab for Column1, I used the Cell Content Style control to select the <p> tag and the class.

However, when I create a table and apply this TableStyle, nothing happens. No <p> and no autonumber.

What am I doing wrong?

TIA
emsachs
Propeller Head
Posts: 91
Joined: Wed Nov 19, 2014 12:49 pm

Re: Cell Content Style in TableStyle Editor

Post by emsachs »

I don't know if this is your problem, but tables do have a little gotcah. When you first create a table, all the cells are plain table cells (td), with no paragraph style. so you won't see the number, because the default paragraph style can only be applied once you have a paragraph. Try clicking in a cell and typing Enter, and see if you get a numbered paragraph. Then delete the second paragraph.
mamarachel
Propeller Head
Posts: 39
Joined: Fri Mar 23, 2007 7:27 am

Re: Cell Content Style in TableStyle Editor

Post by mamarachel »

Thanks, emsachs, that helped. What I had to do was set the table style to create all cells as <p> by setting cell content to <p> on the rows. Then I was able to get column 1 to set as p.StepNum using the Column 1 cell content style control. Of course, this put p.StepNum on the first cell in the header. So each time I create a table, I will need to reset that cell to <p>. I also created a p.StepNum1 class, and I will need to reset the first p.StepNum cell to p.StepNum1 to restart the numbering.
jjw
Sr. Propeller Head
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: Cell Content Style in TableStyle Editor

Post by jjw »

This behaviour in Flare is driving me mad.

If I create a one paragraph table cell, the cell generates to word with a "td" style, but if I add a second paragraph, then Flare wantonly wraps both paragraphs in p tags so they generate to Word with a "p" style. This makes it difficult to control the spacing between the table borders and the contents because different cells have different styles for their first lines. Beyond doing a tedious search and replace for <td><p> (etcetera) there doesn't seem any workaround for this. Am I missing something?

J
Scotty
Propeller Head
Posts: 98
Joined: Thu Feb 02, 2012 6:56 pm
Location: Europe

Re: Cell Content Style in TableStyle Editor

Post by Scotty »

jjw wrote:This behaviour in Flare is driving me mad.

If I create a one paragraph table cell, the cell generates to word with a "td" style, but if I add a second paragraph, then Flare wantonly wraps both paragraphs in p tags so they generate to Word with a "p" style. This makes it difficult to control the spacing between the table borders and the contents because different cells have different styles for their first lines. Beyond doing a tedious search and replace for <td><p> (etcetera) there doesn't seem any workaround for this. Am I missing something?

J
Bump.

Table cells without a return are tagged as <td>.

Table cells with a return contain 2 or more <p> tags, which format differently to <td> tags.

This messes up line spacing quite badly. What am I doing wrong? Or more accurately, how do I fix this?
The newest noob in town.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Cell Content Style in TableStyle Editor

Post by ChoccieMuffin »

Scotty wrote: Table cells without a return are tagged as <td>.

Table cells with a return contain 2 or more <p> tags, which format differently to <td> tags.

This messes up line spacing quite badly. What am I doing wrong? Or more accurately, how do I fix this?
In your stylesheet set up td p so that its spacing are the same as td. (Will have to check, but you may even be able to just change the header for the td tag to:

td,
td p
{
...
}

That should do it. (I think.)
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
jjw
Sr. Propeller Head
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: Cell Content Style in TableStyle Editor

Post by jjw »

It's a bit more difficult though, because you want to have spacing between paragraphs, you just don't want the spacing at the top and bottom of the cell. If you make all the paragraphs look like td elements they won't have any spacing between them.

I guess you could either target just the first and last child paragraph elements:

Code: Select all

td p:first-child { margin-top:0}
td p:last-child { margin-bottom:0}
Or (and I haven't tested this so I don't know if it would work in Word and HTML) you could remove the spacing from all the paragraphs and then put it back by using an adjacent element selector:

td: p + p {margin-top: 1em; margin-bottom: 1em}
Post Reply