Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit b530b5d

Browse files
authored
Update README.md
1 parent 3a581ec commit b530b5d

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Kirby tablex
2-
Simple table field for Kirby CMS
2+
Simple table field for Kirby CMS. Advice, features and sugestions welcome.
33

44
![Kirby tablex GIF](https://raw.githubusercontent.com/floriankarsten/kirby-tablex/stuff/kirby-tablex.gif "Kirby tablex GIF")
55

@@ -23,6 +23,34 @@ Options are not required. Defaults are:
2323
header: false
2424
```
2525
26+
In your template you can simply use kirbys ```toStructure()```
27+
28+
Example:
29+
```
30+
<?php $tableX = $page->table()->toStructure(); ?>
31+
<div class="table">
32+
<table>
33+
<thead>
34+
<tr>
35+
<?php foreach($tableX->header() as $headerCell): ?>
36+
<th><?= $headerCell; ?></th>
37+
<?php endforeach; ?>
38+
</tr>
39+
</thead>
40+
<tbody>
41+
<?php foreach($tableX->tables() as $tableRow): ?>
42+
<tr>
43+
<?php foreach($tableRow as $tableCell): ?>
44+
<td><?= $tableCell; ?></td>
45+
<?php endforeach; ?>
46+
</tr>
47+
<?php endforeach; ?>
48+
</tbody>
49+
</table>
50+
</div>
51+
</div>
52+
```
53+
2654

2755

2856
## Installation

0 commit comments

Comments
 (0)