DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:mobiletable

Mobile Tables Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" unknown
  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" unknown

plugin Rearranges tables to be responsive

Last updated on
2016-07-18
Provides
Syntax, Action
Repository
Source

Tagged with mobile, responsive, tables

By Bleistivt

Installation

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 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
!^! Name   ^ Color ^ Size  ^ Speed   ^
^ Item 1   | Red   | Small | 50 km/h |
^ Item 2   | Green | Large | 30 km/h |

…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, add ! in front of a table's head row:

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

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

Use a second ! as the first character of the cell that you want to make the main/index column. Using the first example again, your could also make the Color column the main column:

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

Additionally this plugin provides <only desktop></only> and <only mobile></only> markup (which it also uses internally) that can be used to hide content from one or the other.

Change Log

Known Bugs and Issues

:!: Footnotes in tables are not carried over to the mobile version.

FAQ

Discussion

plugin/mobiletable.txt · Last modified: 2017-07-07 14:51 by 2003:e5:3bd0:5c63:200c:3cc:c3d7:552f