Tags:
create new tag
, view all tags

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

TWiki version: TWikiRelease04x02x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Ubuntu 7.04
Web server: Apache2
Perl version: 5.8
Client OS: Centos5
Web Browser: firefox3
Categories: Plugins

-- AtleGundersen - 22 Aug 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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. smile

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

 
Change status to:
Topic attachments
I Attachment Action Size Date Who Comment
Cascading Style Sheet filecss MyStyles.css manage 0.1 K 2008-08-22 - 18:57 SeanCMorgan  
Topic revision: r2 - 2008-08-22 - SeanCMorgan
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.