MCPcopy Create free account
hub / github.com/devfeel/dotweb / CreateTablePart

Function CreateTablePart

core/htmlx.go:122–139  ·  view source on GitHub ↗

CreateTablePart create a table part html by replacing flags

(col, title, header, body string)

Source from the content-addressed store, hash-verified

120
121// CreateTablePart create a table part html by replacing flags
122func CreateTablePart(col, title, header, body string) string {
123 template := `<br><table class="bordered">
124 {{col}}
125 <caption>{{title}}</caption>
126 <thead>
127 {{header}}
128 </thead>
129 {{body}}
130 </table>`
131 if col == "" {
132 col = defaultCol
133 }
134 data := strings.Replace(template, "{{col}}", col, -1)
135 data = strings.Replace(data, "{{title}}", title, -1)
136 data = strings.Replace(data, "{{header}}", header, -1)
137 data = strings.Replace(data, "{{body}}", body, -1)
138 return data
139}
140
141// CreateTableHtml create a complete page html by replacing {{tableBody}} and table part html
142func CreateTableHtml(col, title, header, body string) string {

Callers 1

ShowHtmlTableDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected