Permalink
Browse files

Merge pull request #61 from charlesjlee/master

New shortcode "pure_table" to create tables
  • Loading branch information...
yoshiharuyamashita committed Dec 19, 2017
2 parents 2022217 + d4aa502 commit a775981ef8c695f54350e13a4534df6667511ff2
Showing with 33 additions and 0 deletions.
  1. +13 −0 README.md
  2. +20 −0 layouts/shortcodes/pure_table.html
View
@@ -203,6 +203,19 @@ paginate = 10
## Shortcodes
### pure_table
```
{{< pure_table
"columnName1|columnName2|...|columnName99"
"dataValue1|dataValue2|...|dataValue99"
"dataValue1|dataValue2|...|dataValue99"
"dataValue1|dataValue2|...|dataValue99"
"... and so on"
>}}
```
where each positional parameter is separated by the vertical bar (i.e., |). The resulting `<table>` is set to have `class="pure-table pure-table-striped"`.
### fluid_imgs
```
@@ -0,0 +1,20 @@
{{ $fields := (index .Params 0) }}
{{ $data := after 1 .Params }}
<table class="pure-table pure-table-striped">
<thead><tr>
{{ range split $fields "|"}}
<th>{{ . }}</th>
{{ end }}
</thead></tr>
<tbody>
{{ range $data}}
<tr>
{{ $items := split . "|" }}
{{ range $items }}
<td>{{ . }}</td>
{{ end }}
</tr>
{{ end }}
</tbody>
</table>

0 comments on commit a775981

Please sign in to comment.