DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:mobiletable

This is an old revision of the document!


Mobile Tables Plugin

Compatible with DokuWiki

Detritus, Elenor Of Tsort

plugin Rearranges tables to be responsive

Provides
Syntax, Action
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with mobile, responsive, tables

By Bleistivt

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Examples/Usage

This plugin creates a second representation of a table, where all columns are stacked on top of each other, which is only shown for mobile devices. This improves the mobile experience for wide tables as it prevents horizontal scrolling.

In the mobile presentation (specified by your theme's __phone_width__) this:

Name Color Size Speed
Item 1 Red Small 50 km/h
Item 2 Green Large 30 km/h
<mobiletable 1>
^ Name   ^ Color ^ Size  ^ Speed   ^
^ Item 1   | Red   | Small | 50 km/h |
^ Item 2   | Green | Large | 30 km/h |
</mobiletable>

…becomes this:

Item 1
Color Red
Size Small
Speed 50 km/h
Item 2
Color Green
Size Large
Speed 30 km/h

Syntax

To activate mobile tables, wrap it in <mobiletable>…</mobiletable> syntax:

<mobiletable>
^ Name   ^ Color ^ Size  ^ Speed   ^
^ Item 1  | Red   | Small | 50 km/h |
^ Item 2  | Green | Large | 30 km/h |
</mobiletable>

This would create a mobile table like this:

Name Item 1
Color Red
Size Small
Speed 50 km/h
Name Item 2
Color Green
Size Large
Speed 30 km/h

You may specify the index (starting with 1) of the column you want to make the main/index column. Using the first example again, your could also make the Color column the main column:

<mobiletable 2>
^ Name   ^ Color ^ Size  ^ Speed   ^
^ Item 1  | Red    | Small | 50 km/h |
^ Item 2  | Green  | Large | 30 km/h |
</mobiletable>
Red
Name Item 1
Size Small
Speed 50 km/h
Green
Name Item 2
Size Large
Speed 30 km/h

Note that the previous example could also be expressed using the !-syntax for backwards compatibility:

!^ Name   ^! Color ^ Size  ^ Speed   ^
...

However, this syntax is not recommended anymore as it breaks section editing.

Change Log

Known Bugs and Issues

FAQ

Discussion

plugin/mobiletable.1600091145.txt.gz · Last modified: 2020-09-14 15:45 by Bleistivt

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