# dokuwiki-plugin-mobiletable
https://www.dokuwiki.org/plugin:mobiletable
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, wrap it in `...` syntax:
```
^ 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 |
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:
```
^ 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 |
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.