inheriting list indents

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

inheriting list indents

Post by pdenchfield »

I have the print medium of my stylesheet set up so p tags and table tags in lists indent properly, as shown below.

Code: Select all

@media print
{
	ol p
	{
		margin-left: 18pt;
	}

	ol table
	{
		margin-left: 18pt;
	}

	ul p
	{
		margin-left: 18pt;
	}

	ul table
	{
		margin-left: 18pt;
	}
}
However, my PDF output still shows p classes, such as p.figure and p.note, all the way to the left, with no indent at all. Anyone know how I can make p classes within lists indent well in PDFs?
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: inheriting list indents

Post by NorthEast »

I'd guess it is because your p classes include a setting for their left margin.

The styles you defined for the p class will take precedence over the base p style; e.g. the margin setting for p.note will take priority over the margin for p (bear in mind p.note will apply to all mediums if it's not contained in a medium itself).

There are a number of ways to fix it - e.g. add the margins for the p classes in your print medium, or set the margins for your p classes in a non-print medium.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: inheriting list indents

Post by KevinDAmery »

Remember that CSS goes bottom up rather than top down - in other words, any style code in a class over-rides what is in the parent style, not vice versa.

In addition to Dave's suggestions, another option would be to remove margin settings from the classes altogether - then they will inherit from the parent p style.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: inheriting list indents

Post by pdenchfield »

Thanks! Clearing margins from classes solves the problem.

Except for tables. The complex selector "ol table" in the print media seems to have no effect on PDF output. Any ideas?
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: inheriting list indents

Post by KevinDAmery »

Are you using table styles? If so, the problem is that Flare inserts a bunch of inline style code directly into the topic. This over-rides what is in your stylesheet. You would need to clean out that style code to get your stylesheet settings to take effect.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: inheriting list indents

Post by pdenchfield »

I'm not using table styles but your message reminded me that every time I insert a table Flare creates gobbledygook code that I don't want. So it did indeed specify a left margin of zero when I wanted no left margin specified for tables in lists. I removed the left margin setting and the table behaved - but only for the first level of a declared list.

Do I have to create complex selectors for every possible nesting combination? "ol ol table" "ol ul table" etc. etc. I tried adding "ol ul table" to fix the table in a bulleted list I had following a numbered step, but it did not seem to change anything, even when I put in a large margin for a sanity check. Any ideas?
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: inheriting list indents

Post by KevinDAmery »

The "ol ul etc." method works for me, although admittedly I'm not doing it with tables, only with p tags. Just to check your sanity try the same thing with a p tag. If it works there but not for tables, it could be a bug.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: inheriting list indents

Post by LTinker68 »

pdenchfield wrote:I tried adding "ol ul table" to fix the table in a bulleted list I had following a numbered step, but it did not seem to change anything, even when I put in a large margin for a sanity check. Any ideas?
You might need to throw an li in there.

Or... Have you tried the "make paragraph item" option with a custom table class? When you're in a line item (<li> tag), and you want a table to follow it, click on the list item action menu and select Make Paragraph Item(s) from the drop-down list (I think that's the title of the menu option). When you do, it create a paragraph tag as a child of the li tag. You can then insert a table in place of that paragraph. At this point, the table is at the same indent depth as its parent li tag (unless your base table tag has a left margin specified). If you create a custom table class and set its left margin to 20px, for instance, then you can apply that class to the table tag, and it won't matter how deep that table is inside a list -- it will always be 20px indented under its parent tag, whether that parent tag (li tag in this case) is one level deep, two levels deep, or more.

Complex selectors are great but can get complicated the deeper you go, especially if you're using relative dimensions (2ems or 2%) as opposed to fixed dimensions (20px or 20pt).
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: inheriting list indents

Post by pdenchfield »

Thank you, Lisa! I am late in discovering the DTD-compliant ways to insert unnumbered/unbulleted paragraphs in lists. Your suggestion solves the table alignment issues, even with Flare's automatic insertion of a zero value for the new table's left margin. (I tested. If I change the left-margin value to some non-zero value, the base is the parent <li> tag as expected.)

FYI for anyone out there wanting the steps to insert unnumbered/unbulleted paragraphs in lists:
1. Make sure you have the structure blocks turned on in XML Editor. Structure blocks are on the left and they're labeled by tag ("p" or "li" for example).
2. Right-click the <li> block after which you want to insert the non-list paragraph and then select Make Paragraph Item(s).
3. Place your cursor at the end of the content in the <li> block and then press ENTER to add a line. The new line is unnumbered. Ignore the yellow block containing the black arrow. Enter text and apply style.
4. Place your cursor at the end of the text and press ENTER. Click the yellow block containing a black arrow on this line to get the next numbered line.
Post Reply