Add an image to a Table style?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Diana_BB
Sr. Propeller Head
Posts: 147
Joined: Mon Oct 22, 2007 11:46 am
Location: Dallas, TX

Add an image to a Table style?

Post by Diana_BB »

Hi, everyone,
I'm building a new template for an expanded team/rebranding effort at my company. We have been using alert/note tables from various snippets. To create a note, we insert the appropriate snippet, convert it to text, and enter the note text.

The tables each have 2 columns with the first column with an image:
NoteTable.jpg
I would like to create a table style that includes the image in the first column. I know you can't add an image in the Table Style editor, so I'll have to do it directly in the CSS. I've been using Flare for years, but I'm a CSS newbie since I've taken ownership of the template. I know how to include an image in a style class.

Is there a way to create a style class specifically for the first cell in a table (no header rows) so we can add a table and start typing?
Thanks,
Diana
You do not have the required permissions to view the files attached to this post.
Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Add an image to a Table style?

Post by LTinker68 »

I don't think you can. There is a type of complex selector where you can specify what to do to the first tag that appears under another tag, so div > p would set the style of the first paragraph in a div. But tables have lots of levels of tags, and I don't know if there's a complex selector that could specify the attributes for the first <td> tag that appeared in a table, since the td tag could be the grandchild or great-grandchild of the table tag, depending on how the table is set up.

I think the snippet option is the easiest way to go. However, if you're worried about wanting to changing the image later, then you could do a combination snippet/stylesheet option. The snippet contains the table placeholder, and in the first cell you place a paragraph class with a blank space in it. In the stylesheet, you specify the background image for that paragraph class. That way, even if you insert the snippet and convert it to text, the paragraph class is what is calling the image, so if you want a different image, you'd specify a different one in the stylesheet, instead of having to do a find-and-replace throughout the project.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Diana_BB
Sr. Propeller Head
Posts: 147
Joined: Mon Oct 22, 2007 11:46 am
Location: Dallas, TX

Re: Add an image to a Table style?

Post by Diana_BB »

Thanks, Lisa. I've come to the same conclusion in the last couple of hours of research and testing.

I think I'll leave the snippets, as is.

If it ain't broke... :D
Diana
Image
Post Reply