CreateTablePart create a table part html by replacing flags
(col, title, header, body string)
| 120 | |
| 121 | // CreateTablePart create a table part html by replacing flags |
| 122 | func 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 |
| 142 | func CreateTableHtml(col, title, header, body string) string { |