This is an old revision of the document!


Tables and figures

You can give captions to the following items:

  1. tables
  2. figures
  3. image box

The syntax is as follows:

Tables

<table label-of-table>
<caption>Give you caption here and it will be numbered automatically</caption>
^ table head 1 ^ table head 2 ^ table head 3 ^ table head 4 ^
| table cell 1 | table cell 2 | table cell 3 | table cell 4 |
| table cell 5 | table cell 6 | table cell 7 | table cell 8 |
</table>
  • label-of-table should be a unique id to identify the table by the coding system, and it could not contain spaces in it.
  • The above code could be inserted in the tool bar directly so you don't have to type it manually

How the above code looks like in reality:

Table 1: Give you caption here and it will be numbered automatically
table head 1 table head 2 table head 3 table head 4
table cell 1 table cell 2 table cell 3 table cell 4
table cell 5 table cell 6 table cell 7 table cell 8

Figures

<figure label-of-figure>
<caption>Give you caption here and it will be numbered automatically</caption>
{{ :wiki:dokuwiki-128.png |Dokuwiki logo}}
</figure>
  • label-of-figure should be a unique id to identify the figure by the coding system, and it could not contain spaces in it.
  • The above code could be inserted in the tool bar directly so you don't have to type it manually

How it looks like in work:

Figure 1: Give you caption here and it will be numbered automatically
Dokuwiki logo

The picture could be replaced by a chart or plot if required, for example:

<figure pie-chart-1>
<caption>Caption for the pie chart</caption>
<c3>
  // some comment
  data: {
    columns: [
      ['data1', 30], /* more comment */
      ['data2', 120],
    ],
    type : 'pie',
  }
</c3>
</figure>
Figure 2: Caption for the pie chart
<c3>
// some comment
data: {
  columns: [
    ['data1', 30], /* more comment */
    ['data2', 120],
  ],
  type : 'pie',
}

</c3>

Image box

Occasionally you may need to include a image box in the page but does not want it to look like a figure. In this case, you may just use an image box.

<imagebox label-of-imagebox>
{{ :wiki:dokuwiki-128.png |Dokuwiki logo}}
<caption>This is an image box</caption>
</imagebox>
  • label-of-imagebox should be a unique id to identify the image box by the coding system, and it could not contain spaces in it.
  • The above code could be inserted in the tool bar directly so you don't have to type it manually
  • All image boxes are 200px in width and will be arranged to the right of the page on screen larger than 576 pixels in width

How it looks like in work (see Image ##REF:label-of-imagebox##):

<imagebox label-of-imagebox> Dokuwiki logo <caption>This is a image box</caption> </imagebox>

Reference

What if I need to refer to a table/figure/image box in the text? We can simply refer to it's label.

For more ideas, please see Table {{ref>label-of-table}}.

How it works in reality:

For more ideas, please see Table 1.