%audience% authors (intermediate)
There are four directives for table processing. All must be at the beginning of a line to have any effect.
(:table (attr...):)
Generates a new HTML
" causes subsequent text on that line to be treated as preformatted text. Valid attributes and values are:
|
For the table, cell, and cellnr tags the author can specify any attributes that would be valid in the HTML
<table border=1 cellpadding=5 cellspacing=0> <cell> a1 <cell> b1 <cell> c1 <cell> d1 <cellnr> a2 <cell> b2 <cell> c2 <cell> d2 </table> | ||||||||
|
In HTML, this is the same as
->
<table border='1' cellpadding='5' cellspacing='0'> <tr> <td>a1</td> <td>b1</td> <td>c1</td> <td>d1</td> </tr> <tr> <td>a2</td> <td>b2</td> <td>c2</td> <td>d2</td> </tr> </table>
Navigation Links |
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 > <cellnr> '''Navigation Links''' <cellnr> *[[Tables]] *[[Table directives]] </table> | ||
|
<table border=1 width=30% align=right bgcolor=#cccc99 cellspacing=0 > <cellnr colspan=2 align=center> '''Navigation Links''' <cellnr align=center> [[Tables]] <cell align=center> [[Table directives]] </table> | ||||
|
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. Pretty sweet!
%trail% <<|Documentation Index|>>
Q: Can I define table headers using the table directive markup?
A: No, but you can with Cookbook:AdvancedTableDirectives. See Pm's reply to pending PITS:00535