| 1 | {{- $regionLabel := "Scrollable table" -}} |
| 2 | {{- with index .Attributes "aria-label" -}} |
| 3 | {{- $regionLabel = . -}} |
| 4 | {{- end -}} |
| 5 | <div class="table-scroll" role="region" aria-label="{{ $regionLabel }}" tabindex="0"> |
| 6 | <table |
| 7 | {{- range $k, $v := .Attributes }} |
| 8 | {{- if $v }} |
| 9 | {{- printf " %s=%q" $k $v | safeHTMLAttr }} |
| 10 | {{- end }} |
| 11 | {{- end }}> |
| 12 | <thead> |
| 13 | {{- range .THead }} |
| 14 | <tr> |
| 15 | {{- range . }} |
| 16 | <th |
| 17 | {{- with .Alignment }} |
| 18 | {{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }} |
| 19 | {{- end -}} |
| 20 | > |
| 21 | {{- .Text -}} |
| 22 | </th> |
| 23 | {{- end }} |
| 24 | </tr> |
| 25 | {{- end }} |
| 26 | </thead> |
| 27 | <tbody> |
| 28 | {{- range .TBody }} |
| 29 | <tr> |
| 30 | {{- range . }} |
| 31 | <td |
| 32 | {{- with .Alignment }} |
| 33 | {{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }} |
| 34 | {{- end -}} |
| 35 | > |
| 36 | {{- .Text -}} |
| 37 | </td> |
| 38 | {{- end }} |
| 39 | </tr> |
| 40 | {{- end }} |
| 41 | </tbody> |
| 42 | </table> |
| 43 | </div> |