Created
May 23, 2019 19:50
-
-
Save fieldingtron/1530c23a21df29052e2afac26d9af09d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{$tablename:="table"}} {{ (printf "%s%s" "$.Page.Params." $tablename) }} | |
<table class=" rtable"> table table-striped table-sm | |
{{$count :=0}} | |
{{$colname := slice }} | |
{{ $.Page.Params}} | |
{{ range $.Page.Params.table }} | |
{{ if eq $count 0}} | |
<thead> | |
{{ range . }} | |
{{ $colname = $colname | append . }} | |
<th>{{.}}</th> | |
{{ end }} | |
</thead><tbody> | |
{{ else }} | |
<tr> | |
{{$colcount :=0}} | |
{{ range . }} | |
<td data-title='{{index $colname $colcount}}'> {{.}}</td> | |
{{ $colcount = (add $colcount 1) }} | |
{{ end }} | |
</tr> | |
{{ end }} | |
{{ $count = (add $count 1) }} | |
{{end}} | |
</tbody> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment