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?
Image in a Table Style Sheet
-
- Propeller Head
- Posts: 14
- Joined: Tue Feb 27, 2007 7:33 am
- Location: Durban, South Africa
Re: Image in a Table Style Sheet
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?
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
- Propeller Head
- Posts: 14
- Joined: Tue Feb 27, 2007 7:33 am
- Location: Durban, South Africa
Re: Image in a Table Style Sheet
It will be an icon, with text next to it.
Re: Image in a Table Style Sheet
.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.
Re: Image in a Table Style Sheet
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.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
- Propeller Head
- Posts: 14
- Joined: Tue Feb 27, 2007 7:33 am
- Location: Durban, South Africa
Re: Image in a Table Style Sheet
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?
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?
-
- Propeller Head
- Posts: 14
- Joined: Tue Feb 27, 2007 7:33 am
- Location: Durban, South Africa
Re: Image in a Table Style Sheet
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.
.TableStyle_TableStyleSheetName = width 100%.
.TableStyle_TableStyleSheetName_Body_0_0_RowEnd_ColSep = display: table-cell and width: 20px.