blob: 61457b76c79d77453f0eef1cd41c1d88faa9dec9 [file] [log] [blame]
version=pmwiki-2.0.beta10
newline
time=1103526523
textThere are four tags for large-scale table processing. All must be at the beginning of a line to have any effect.²²!!![@(:table (attr...):)@]²ends any previous table (equivalent to [@(:tableend:)@]), and generates a new HTML <table> tag with the attributes given by attr. Valid attributes and values:²* border ''(a positive integer)''²* bordercolor ''(a color name or hex number; doesn't display in all browsers)''²* cellspacing ''(a positive integer indicating the space between cells)''²* cellpadding ''(a positive integer indicating the interior border of a cell)''²* width ''(a positive integer or percent)''²* bgcolor ''(a color name or hex number)''²* align ''(left, center or right)''²* summary ''(does not display; used primarily to help visually disabled people navigate)''²²!!![@(:cell (attr...):)@]²closes the previous table cell, if any, and generates a new cell with the attributes given by attr. In HTML, this creates a new "<td attr>" tag (and possibly <table>, <tr>, and </td> tags if they are needed to produce a valid HTML table).²* align ''(left, center or right)''²* valign ''(top, middle or bottom)''²* colspan ''(a positive integer)''²* rowspan ''(a positive integer)''²* bgcolor ''(a color name or hex number)''²* width ''(a positive integer or percent)''²²!!![@(:cellnr (attr..):)@]²closes the previous table cell, if any, and generates a new cell at the beginning of the next row. In HTML, this creates a "<tr><td attr>" tag, and possibly <table>, </td>, and </tr> tags if they are needed for valid HTML.²* align ''(left, center or right)''²* valign ''(top, middle or bottom)''²* colspan ''(a positive integer)''²* rowspan ''(a positive integer)''²* bgcolor ''(a color name or hex number)''²* width ''(a positive integer or percent)''²²!!![@(:tableend:)@]²closes the previous table cell and closes off any table. Generates </td>, </tr>, and </table> tags as needed.²²For the table, cell, and cellnr tags the author can specify any attributes that would be valid in the HTML <table> or <td> tags. Thus you can specify rowspan, colspan, etc. arguments to build arbitrary tables. However, it's not possible to nest a [@(:table:)@] inside of a [@(:cell:)@] or [@(:cellnr:)@] -- the next paragraph explains why.²²Many are likely to ask why we didn't just use the standard HTML table markup (<table>, <tr>, <td>, <th>) instead of creating a new markup, and allowing nested tables as a result. There are two answers: first, the HTML table markup is very ugly for naive authors (see PmWiki.Audiences and PmWiki.PmWikiPhilosophy #2), and second, it'd be very easy for authors to create tables that are incorrect HTML and that display incorrectly (or not at all) on some browsers. Even seasoned web professionals sometimes get the table markup wrong, so it's a bit unrealistic to expect the average author to always get it right, or to be able to read arbitrary HTML table markup that someone else has created.²²-> %color=green% ''Common comment:'' Surely, the average or naive author would not be writing HTML directly, but using a tool, such as [=FrontPage=], or even [=MSWord=], to generate the HTML. This would be a lot simpler than learning even the simplest PmWiki markups.²²-> %color=green% ''Pm's Response:'' And once the HTML has been generated and posted, how is someone else going to edit or modify the table if they don't have the original [=FrontPage or MSWord=] file used to create it? Remember that we're talking about ''collaborative'' authoring. The HTML that those packages generate is among the hardest to read and edit of all!²²It's difficult to write the code needed to make PmWiki understand and fix arbitrary table markup, so PmWiki uses the simplified version above. Still, this version is able to handle most table requirements (with the possible exception of nested tables).²²And, this is not to say that nested HTML tables are impossible in PmWiki --they just can't be easily created by wiki authors using the default wiki markup. A site administrator can of course create header/footer HTML code and other LocalCustomizations that make use of nested tables.²²'''''Example 1. A table using advanced markup.'''''²²(:markup:) [=²(:table border=1 cellpadding=5 cellspacing=0:)²(:cell:) a1²(:cell:) b1²(:cell:) c1²(:cell:) d1²(:cellnr:) a2²(:cell:) b2²(:cell:) c2²(:cell:) d2²(:tableend:)²=]²²²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>=]²²%trail%<<|PmWiki.DocumentationIndex|>>
author=Pm
name=PmWiki.AdvancedTables
host=24.1.28.47
agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
rev=6
targets=PmWiki.PmWiki,PmWiki.PmWikiPhilosophy,PmWiki.LocalCustomizations,PmWiki.SimpleTables2,PmWiki.InterMap,PmWiki.DocumentationIndex