[table:id A Simple Table [[Heading 1] [Heading 2] [Heading 3]] [[R0-C0] [R0-C1] [R0-C2]] [[R1-C0] [R1-C1] [R1-C2]] [[R2-C0] [R2-C1] [R2-C2]] ]
will generate:
Table 12.2. A Simple Table
Heading 1 |
Heading 2 |
Heading 3 |
---|---|---|
R0-C0 |
R0-C1 |
R0-C2 |
R1-C0 |
R1-C1 |
R1-C2 |
R2-C0 |
R2-C1 |
R2-C2 |
The table title is optional. The first row of the table is automatically
treated as the table header; that is, it is wrapped in <thead>...</thead>
XML tags. Note that unlike the original QuickDoc, the columns are nested
in [cells... ].
Giving tables an id is a new feature for quickbook 1.5 onwards. As with sections, the id is optional. If the table has a title but no id, an id will be generated from the title. The table above can be linked to using:
[link quickbook.syntax.block.tables.id link to table]
which will generate:
The syntax is free-format and allows big cells to be formatted nicely. Example:
[table Table with fat cells [[Heading 1] [Heading 2]] [ [Row 0, Col 0: a small cell] [ Row 0, Col 1: a big fat cell with paragraphs Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use. ] ] [ [Row 1, Col 0: a small cell] [Row 1, Col 1: a small cell] ] ]
and thus:
Table 12.3. Table with fat cells
Heading 1 |
Heading 2 |
---|---|
Row 0, Col 0: a small cell |
Row 0, Col 1: a big fat cell with paragraphs Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use. |
Row 1, Col 0: a small cell |
Row 1, Col 1: a small cell |
Here's how to have preformatted blocks of code in a table cell:
[table Table with code [[Comment] [Code]] [ [My first program] [`` #include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; } ``] ] ]
Table 12.4. Table with code
Comment |
Code |
---|---|
My first program |
#include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; } |