table.html 813 B

123456789101112131415161718192021222324252627282930
  1. {{- /*
  2. Usage: `table [args]`
  3. `args` are optional and can be one of the following:
  4. class: any class(es) to be added to the `table` - default ""
  5. simplified: show a simplified version in the examples - default `true`
  6. */ -}}
  7. {{- $simplified := .Get "simplified" | default true -}}
  8. {{- $table_attributes := "" -}}
  9. {{- $table_content := " ...\n" -}}
  10. {{- with .Get "class" -}}
  11. {{- $table_attributes = printf ` class="%s"` . -}}
  12. {{- end -}}
  13. {{- if eq $simplified "false" -}}
  14. {{- $table_content = partialCached "table-content" . -}}
  15. {{- end -}}
  16. {{- $table := printf "<table%s>\n%s</table>" $table_attributes $table_content -}}
  17. <div class="bd-example">
  18. <table{{ with .Get "class" }} class="{{ . }}"{{ end }}>
  19. {{ partialCached "table-content" . }}
  20. </table>
  21. </div>
  22. {{- highlight $table "html" "" -}}