DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:adhoctables

This is an old revision of the document!


Ad-Hoc Tables Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" unknown

plugin Adds HTML table syntax to the Ad-Hoc Tags plugin.

Last updated on
2023-04-20
Provides
Syntax
Repository
Source
Requires
adhoctags

Extends the Ad-Hoc Tags plugin by adding support for HTML-like table tags.

:!: This plugin is still in an early development stage. Please test it thoroughly and report errors!

Installation

:!: External requirements: This plugin requires the following additional components that must be installed separately:

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Examples/Usage

This plugin allows you to create HTML tables like the following:

<table>
<thead>
<th>Heading 1</th><th>Heading 2</th><th>Heading 3</th></tr>
</thead>
<tbody>
<tr><th>Row 1 Col 1</th><td>Row 1 Col 2</td><td>Row 1 Col 3</td></tr>
<tr><th>Row 2 Col 1</th><td [colspan=2]>Spanning two columns</td></tr>
<tr><th>Row 3 Col 1</th><td>Row 3 Col 2</td><td>Row 3 Col 3</td></tr>
</tbody>
</table>

Obviously, this is not very useful for such simple tables, as the same can also be achieved with simple Wiki tables, as described in the Wiki Syntax.

It becomes interesting when you need to add additional attributes to any of the tags. You can use the attribute syntax of the Ad-Hoc Tags, e.g. to add class names or IDs:

<table #Overview narrow float-right>

Aside from class names, the main use-case for this plugin are inline styles, as in the following example:

<td [style=background-color:#9CF]>

Syntax

This plugin adds the following tags to the DokuWiki syntax:

  • <table>base table element
  • <caption>table caption
  • <colgroup>table column group, with optional attribute:
    • [span=…] – number of columns the group should span (integer: 1…1000)
  • <col>table column, with optional attribute:
    • [span=…] – number of columns (integer: 1…1000)
  • <tbody>table body section
  • <tr>table row
  • <th>table heading cell, with optional attribute:
    • [abbr=…] – a short (“abbreviated”) alternative description of the cell (free-text)
    • [colspan=…] – number of columns the cell should span (integer: 1…1000)
    • [headers=…] – IDs of higher-level table header cells that this cell is related to (space-separated list of IDs)
    • [rowspan=…] – number of columns the cell should span (integer: 1…1000)
    • [scope=…] – which cells does the header cell refer to (either row, col, rowgroup or colgroup)
  • <td>table cell, with optional attribute:
    • [colspan=…] – number of columns the cell should span (integer: 1…1000)
    • [headers=…] – IDs of table header cells that this cell is related to (space-separated list of IDs)
    • [rowspan=…] – number of columns the cell should span (integer: 1…1000)

Note that in addition to the specific attributes, also all the general attributes from the Ad-Hoc Tags-plugin can be added. This includes: #id, class, :lang, and other extended attributes, like [style=…].

Configuration and Settings

There are currently no configuration settings for this plugin.

plugin/adhoctables.1681937825.txt.gz · Last modified: 2023-04-19 22:57 by sascha-leib

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki