Question
Hi!
Using the
TablePlugin page. I can't find a way to set the width of my cell borders in an table. I am only able to set the width of the table surrounding box, and control which of the table 4 sides to set. I use the %TABLE{...} before my table statement.
Is it at all possible to set borders between cell, columns, rows?
And how can one set the color of the borderlines?
Environment
--
AtleGundersen - 22 Aug 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
>
I can't find a way to set the width of my cell borders in an table...
>
Is it at all possible to set borders between cell, columns, rows?
Those are standard features of the plugin. It didn't quite work in TWiki 4.1 (column dividers didn't work, as you can see here). But you're in luck, that was fixed in TWiki 4.2.0.
%TABLE{cellborder="5" tablerules="all"}%
| Header 1 |
Header 2 |
| Cell 1 |
Cell 2 |
| Cell 3 |
Cell 4 |
>
how can one set the color of the borderlines?
That's a bit trickier. The
TablePlugin topic hints at that, "the
TABLEATTRIBUTE settings can be overridden by a skin's CSS". Now here's how you can actually do it.
If you're using the
PatternSkin, colors are defined in
/pub/TWiki/PatternSkin/colors.css. (As I have recently discovered) rather than modifying those files directly, it is recommended that your changes be entered in a new file (or files). That makes your changes upgrade-independent, so that they don't get overwritten the next time you apply a code patch. Then define a variable that references that file like so (I have attached a customized stylesheet to this topic):
* Set USERSTYLEURL = %PUBURL%/%WEB%/%TOPIC%/MyStyles.css
This variable definition can be used in a single topic (as I have done here), or in TWikiPreferences to make the change apply throughout the site. It can also be a user preference. See
PatternSkinCustomization and
PatternSkinPalette for more examples.
P.S. you could simply change the style definition in the topic itself, but an external stylesheet can be re-used in multiple topics, and it gets cached in the browser which improves performance.
--
SeanCMorgan - 22 Aug 2008