Image in a Table Style Sheet

This forum is for all Flare issues related to styles, stylesheets and XML.

Image in a Table Style Sheet

Postby SusanNicholson on Tue May 13, 2008 10:19 am

I want to define in a table style sheet, an image to display in the first cell of a header row of a table.

I can get text to display using the 'content' paramter for the applicable ColSep style, but cannot get images to work. I have tried the 'background-image', but the image does not display.

Does anyone know how I can achieve this?
SusanNicholson
Propeller Head
 
Posts: 14
Joined: Tue Feb 27, 2007 7:33 am
Location: Durban, South Africa

Re: Image in a Table Style Sheet

Postby LTinker68 on Tue May 13, 2008 10:36 am

Is there going to be text next to the image or over the image? That is, is it going to be like an icon or act as background image for that cell?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Image in a Table Style Sheet

Postby SusanNicholson on Tue May 13, 2008 10:47 pm

It will be an icon, with text next to it.
SusanNicholson
Propeller Head
 
Posts: 14
Joined: Tue Feb 27, 2007 7:33 am
Location: Durban, South Africa

Re: Image in a Table Style Sheet

Postby Dave Lee on Wed May 14, 2008 1:47 am

SusanNicholson wrote:I want to define in a table style sheet, an image to display in the first cell of a header row of a table.

I can get text to display using the 'content' paramter for the applicable ColSep style, but cannot get images to work. I have tried the 'background-image', but the image does not display.

Does anyone know how I can achieve this?
.

I just did a quick test and got this working ok.

One problem is that the Flare table stylesheet editor doesn't let you set a background image, so you need to manually edit the table stylesheet to set the background image.
However, if you later change the table in the table stylesheet editor, it will regenerate the entire stylesheet and you'll lose your manual edit - so you'll need to redo this again if you ever change your table styles.

As the image is just in the first cell of the header row and not in the other header cell, you need to set up 2 column patterns. In the table stylesheet editor, set up 2 column patterns - pattern 1 with a repeat of 1, and pattern 2 with a repeat of say 100 (i.e. so that pattern 1 never repeats).

Make sure all your table styles are the way you want them, then close the table stylesheet editor.

Insert the table in a topic, and move the cursor to the cell in the top left. From the Styles panel, click Edit Style.

Flare will open the table stylesheet in the normal stylesheet editor (not the table stylesheet editor), and display the (generic) class properties for that cell, e.g. TableStyle_YourTable_Head_0_0_RowSep_ColSep.

Set the background-image property for this style.


One thing, the Flare editor has problems with background images and doesn't always show them, so don't rely on it and check the preview and output.
Dave Lee
Master Propellus Maximus
 
Posts: 5822
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Image in a Table Style Sheet

Postby LTinker68 on Wed May 14, 2008 8:26 am

Actually, I was going to suggest make a custom class (in the main stylesheet) for the table header. Change the display of that custom table header from block to list, then specify an image for the list icon (using your image for the bullet icon). Then you apply that class to the header cell where you want the image to be.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Image in a Table Style Sheet

Postby SusanNicholson on Fri May 16, 2008 3:04 am

Thanks, Dave! The repeat column bit sorted out my issue.

Another thing I want to control using the style sheet, is the column widths. I just can't get the sizes to apply though! Any ideas on this?
SusanNicholson
Propeller Head
 
Posts: 14
Joined: Tue Feb 27, 2007 7:33 am
Location: Durban, South Africa

Re: Image in a Table Style Sheet

Postby SusanNicholson on Fri May 16, 2008 5:17 am

I managed to control the column widths by configuring the following:

.TableStyle_TableStyleSheetName = width 100%.
.TableStyle_TableStyleSheetName_Body_0_0_RowEnd_ColSep = display: table-cell and width: 20px.
SusanNicholson
Propeller Head
 
Posts: 14
Joined: Tue Feb 27, 2007 7:33 am
Location: Durban, South Africa


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 5 guests