2020-03-24 15:00:00 +01:00
|
|
|
{{- /*
|
|
|
|
Usage: `table [args]`
|
|
|
|
|
|
|
|
`args` are optional and can be one of the following:
|
2021-01-16 20:51:12 +01:00
|
|
|
* class: any class(es) to be added to the `table` - default ""
|
|
|
|
* simplified: show a simplified version in the examples - default `true`
|
2020-03-24 15:00:00 +01:00
|
|
|
*/ -}}
|
|
|
|
|
2021-01-16 20:51:12 +01:00
|
|
|
{{- $class := .Get "class" -}}
|
2020-03-24 15:00:00 +01:00
|
|
|
{{- $simplified := .Get "simplified" | default true -}}
|
|
|
|
|
|
|
|
{{- $table_attributes := "" -}}
|
|
|
|
{{- $table_content := " ...\n" -}}
|
|
|
|
|
2021-01-16 20:51:12 +01:00
|
|
|
{{- with $class -}}
|
|
|
|
{{- $table_attributes = printf ` class="%s"` . -}}
|
2020-03-24 15:00:00 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if eq $simplified "false" -}}
|
2021-01-16 20:51:12 +01:00
|
|
|
{{- $table_content = partialCached "table-content" . -}}
|
2020-03-24 15:00:00 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $table := printf "<table%s>\n%s</table>" $table_attributes $table_content -}}
|
|
|
|
|
|
|
|
<div class="bd-example">
|
2021-01-16 20:51:12 +01:00
|
|
|
<table{{ with $class }} class="{{ . }}"{{ end }}>
|
2020-03-24 15:00:00 +01:00
|
|
|
{{ partialCached "table-content" . }}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{- highlight $table "html" "" -}}
|