[pmwiki-users] Styling table cells

Ian MacGregor ardchoille42 at me.com
Wed Oct 30 16:42:22 CDT 2013


Define a special styling for a specific table in your CSS file (note the "specialtable" class):

.specialtable th {
text-align: left;
background-color: #eee;
line-height: 1em;
margin-top: 0.2em;
margin-bottom: 0.1em;
padding-left: 5px;
}

.specialtable td {
similar but not identical
}

In a wiki page, use the "specialtable" class to style the table:

>>specialtable<<
(:table:)
(:headnr:)
blah
(:head:)
blah
(:cellnr:)
blah
(:cell:)
blah
(:tableend:)
>><<

This will style just the tables that use the specialtable class without styling all tables site-wide. You can change the class name "specialtable" to anything you want but the class in the CSS file and the styling in the wiki page must match.

Regards,
Rev. Ian MacGregor
http://www.ianmacgregor.net

> On Oct 30, 2013, at 2:12 PM, Peter Payzant <pce at accesswave.ca> wrote:
> 
> Am I missing something? I'd like to apply some CSS styling to table cells. I can make it work like this:
> 
> (:headnr align=left style="background-color:#eee;line-height:1.9em;margin-top:0.2em;margin-bottom:0.1em;padding-left:5px":)
> 
> (:cell [similar but not identical] :)
> 
> but repeating this for each cell is tedious and hard to maintain.
> 
> I tried creating pub/css/local.css and defining a style there, but rewriting the above as
> 
> (:headnr align=left class="test":)
> 
> had no effect. PmWiki has many ways to do styling; maybe I'm missing some crucial fact.
> 
> Thanks for any comments!
> 
> Peter
> 
> 
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users



More information about the pmwiki-users mailing list