#!/usr/local/bin/php
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /cgihome/cis520/html/dynamic/2016/wiki/pmwiki.php on line 691
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /cgihome/cis520/html/dynamic/2016/wiki/pmwiki.php on line 694
Warning: Use of undefined constant MathJaxInlineCallback - assumed 'MathJaxInlineCallback' (this will throw an Error in a future version of PHP) in /cgihome/cis520/html/dynamic/2016/wiki/cookbook/MathJax.php on line 84
Warning: Use of undefined constant MathJaxEquationCallback - assumed 'MathJaxEquationCallback' (this will throw an Error in a future version of PHP) in /cgihome/cis520/html/dynamic/2016/wiki/cookbook/MathJax.php on line 88
Warning: Use of undefined constant MathJaxLatexeqrefCallback - assumed 'MathJaxLatexeqrefCallback' (this will throw an Error in a future version of PHP) in /cgihome/cis520/html/dynamic/2016/wiki/cookbook/MathJax.php on line 94
PmWiki /
Table directives← Tables | Documentation Index | Wiki styles → authors (intermediate)
There are six directives for table processing. All must be at the beginning of a line to have any effect.
|
(:table border=1 cellpadding=5 cellspacing=0:) | ||||||||
|
In HTML, this is the same as
<table border='1' cellpadding='5' cellspacing='0'> <tr> <th>a1</th> <td>b1</td> <td>c1</td> <td>d1</td> </tr> <tr> <th>a2</th> <td>b2</td> <td>c2</td> <td> </td> </tr> </table>
What if you wanted to create a nice little table like a table of contents in a page like this? In this example, the table is floating right and contains some links in a bulleted list. This is a nice demonstration of how it’s possible to build a little table of contents in the page, which might navigate to other pages just within the same wiki group. Note that having a bulleted list won’t work in a ordinary table - it only works inside an table created with table directives such as the example code used here.
(:table border=1 width=30% align=right bgcolor=#cccc99 cellspacing=0 :) | ||
|
(:table border=1 width=30% align=right bgcolor=#cccc99 cellspacing=0 :) | ||||
|
Looking at the markup here, notice that we have used a #cccc99 hex color for the table background. Also, the (:cellnr:)
markup creates a new row, a new cell and closes the row at the end.
You could take this concept a little further: since you might want each page in the group to contain the same table of contents, you can make ONE table like the above and put it in its own page. Then use an include on any of your pages and bring in the table. The float (align) property will be honored in each page where it’s included.
Q Can I define table headers using the table directive markup?
Yes, use (:head:)
or (:headnr:)
with PmWiki version 2.2.11 or newer. See also Cookbook:AdvancedTableDirectives.
Q Is it possible to do nested tables?
Yes, if you nest simple tables inside advanced tables. See also Cookbook:AdvancedTableDirectives.
Q Is it possible to add background images to tables and table cells?
Yes, see Cookbook:BackgroundImages.
Q Is it possible to apply styles to the elements of the table, like an ID to the table row, or a class/style to the TD?
Yes, see $WikiStyleApply.
Q Is it possible to automatically generate columns or rows in tables, i.e. without having to do a lot of counting?
Yes, this is possible with the Cookbook:CreateColumns recipe - it allows you to specify a certain number of columns, and/or to specify a certain number of items per column. Plus, someone has provided some similar markup on the TableDirectives-Talk page.
← Tables | Documentation Index | Wiki styles →
This page may have a more recent version on pmwiki.org: PmWiki:TableDirectives, and a talk page: PmWiki:TableDirectives-Talk.