I see two alternatives for custom formatting of table columns. For example, I want to center the text in the three right-most columns but left-align the text in the left column.
Option 1: Apply a td-specific class from the "TableStyles" CSS.
Option 2: Apply a p-specific class from the "Stylesheets" CSS.
The first option seems the easiest and most logical, until I add or delete a column/row. When I do that, my td-specific classes are removed and I have to reapply them.
The second option creates more work. When I create a table, I have to press Enter in each table cell to make it a <p> tag so my p-specific classes are available.
Have I missed something with the above? Are there other options out there?
table column formatting
-
pdenchfield
- Propellus Maximus
- Posts: 574
- Joined: Tue Oct 03, 2006 7:56 am
- Location: Seattle, WA
- Contact:
table column formatting
Pamela Denchfield
http://www.pameladenchfield.com
http://www.pameladenchfield.com
Re: table column formatting
Is there another reason why you're using the table stylesheet? For instance, are you alternating row colors or column colors? If you aren't -- if you're doing a plain table -- then there's no reason why you need to use the table stylesheet and you can just use the normal tags (th, td, tr, etc.) in the main topic stylesheet.
If you are doing alternating rows or columns, then it's trickier. To be honest, I still manually apply background colors to alternating rows using the main topic stylesheet because the table stylesheet still isn't as flexible as I'd like. It's a bit of a pain if I add a row in the middle and it throws off my row colors, but in the long run, it still seems faster to me to manually go through and modify the rows than to try to do a mix of table stylesheet settings and main topic stylesheet settings, because the table stylesheet doesn't have options for padding and alignment and such.
You might be able to do something with the table stylesheet by creating four column patterns, even if they all have the same background color, border styles, etc. You'd then have to open the table stylesheet manually, but then you can add the code for left alignment on the first column pattern and center alignment on the other three column patterns. It results in a lot more code in the topic, but it'll be automated for when you add additional rows and such. Although adding another column will screw things up.
If you are doing alternating rows or columns, then it's trickier. To be honest, I still manually apply background colors to alternating rows using the main topic stylesheet because the table stylesheet still isn't as flexible as I'd like. It's a bit of a pain if I add a row in the middle and it throws off my row colors, but in the long run, it still seems faster to me to manually go through and modify the rows than to try to do a mix of table stylesheet settings and main topic stylesheet settings, because the table stylesheet doesn't have options for padding and alignment and such.
You might be able to do something with the table stylesheet by creating four column patterns, even if they all have the same background color, border styles, etc. You'd then have to open the table stylesheet manually, but then you can add the code for left alignment on the first column pattern and center alignment on the other three column patterns. It results in a lot more code in the topic, but it'll be automated for when you add additional rows and such. Although adding another column will screw things up.
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: table column formatting
I'm not alternating row colors or column colors, but I am using unique shading for heading rows and body rows (plus a third shading, or background color, for certain table cells). Have you had success avoiding use of a "TableStyles" CSS when background color is needed for all table cells?
Pamela Denchfield
http://www.pameladenchfield.com
http://www.pameladenchfield.com
Re: table column formatting
Sure. If ALL of your tables are going to have the same look, then you can modify the <th> tag for the cells in the header row and the <td> tag for all other cells in the table. If you want a footer row, then create a custom <td> class (or <tr>) and apply it to the appropriate cells (or row). And for those cells with unique shading, then create and apply another custom <td> class just to those cells. Which, by the way, you wouldn't be able to do at all with the table stylesheet.
If your tables are going to have different appearances, then create custom classes and apply them to the appropriate elements. I don't have Flare running at the moment, so I can't remember if it'll automatically pick up the appropriate styles when you insert a new row or column. It might depend on how you insert the rows or columns. Even if it doesn't, it's not that hard to select the row or all the cells in the row or column and apply a custom class to them.
If your tables are going to have different appearances, then create custom classes and apply them to the appropriate elements. I don't have Flare running at the moment, so I can't remember if it'll automatically pick up the appropriate styles when you insert a new row or column. It might depend on how you insert the rows or columns. Even if it doesn't, it's not that hard to select the row or all the cells in the row or column and apply a custom class to them.
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: table column formatting
Thank you! I discovered that I can avoid losing td classes if I avoid using the TableStyles CSS. I am now relying on th, td, and td classes in the StyleSheets CSS to get the background and text alignment properties I want, without having to reapply if I delete or add rows. Yay!
Word to the wise (or "a tip for anyone else discovering this style issue late in the game"): If you want to fix all your tables to avoid losing styles as described above, change the table properties to point to "default" for Table Styles. Do this instead of editing through the internal text editor (which would take a horrendous amount of time due to Flare's extensive table style naming schemes, which are somehow done by relative row/column position). As long as your StyleSheets CSS has th, td, and td class tags that contain the desired formatting information, your tables will look no different, but now will have the added benefit of not losing the class tags.
Word to the wise (or "a tip for anyone else discovering this style issue late in the game"): If you want to fix all your tables to avoid losing styles as described above, change the table properties to point to "default" for Table Styles. Do this instead of editing through the internal text editor (which would take a horrendous amount of time due to Flare's extensive table style naming schemes, which are somehow done by relative row/column position). As long as your StyleSheets CSS has th, td, and td class tags that contain the desired formatting information, your tables will look no different, but now will have the added benefit of not losing the class tags.
Pamela Denchfield
http://www.pameladenchfield.com
http://www.pameladenchfield.com