add goshipit a component library fro templ
This commit is contained in:
28
pkg/web/components/base/table.templ
Normal file
28
pkg/web/components/base/table.templ
Normal file
@@ -0,0 +1,28 @@
|
||||
package base
|
||||
|
||||
templ Table(headers []templ.Component, rows []templ.Component, attrs templ.Attributes) {
|
||||
<div class="overflow-x-auto">
|
||||
<table { attrs... } class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
for _, header := range headers {
|
||||
<th>
|
||||
@header
|
||||
</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
for _, trow := range rows {
|
||||
@trow
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
// Component to use as plain text when
|
||||
// templ.Component is used as argument
|
||||
templ PlainText(content string) {
|
||||
{ content }
|
||||
}
|
||||
Reference in New Issue
Block a user