diff options
author | Charles Lee <charleslee592@gmail.com> | 2017-12-18 03:44:56 +0300 |
---|---|---|
committer | Charles Lee <charleslee592@gmail.com> | 2017-12-18 03:44:56 +0300 |
commit | d4aa50207f1dc37bd665b91fa21cff9e26a80fc6 (patch) | |
tree | 678f402ff73399c2d07fe08e65d4aa0805985789 /layouts | |
parent | 202221722a93ea876d6a7981540ae9dec225cd1d (diff) |
new shortcode pure_table
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/pure_table.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/layouts/shortcodes/pure_table.html b/layouts/shortcodes/pure_table.html new file mode 100644 index 0000000..91236bc --- /dev/null +++ b/layouts/shortcodes/pure_table.html @@ -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>
\ No newline at end of file |