FIX: Formatting issues solved by not parsing

This commit is contained in:
Azpect3120 2024-08-07 15:11:01 -07:00
parent 5cbe004318
commit 6dc9c19749

View File

@ -1,6 +1,8 @@
package templates package templates
import "fmt" import (
"fmt"
)
// Table wrapper definitions // Table wrapper definitions
const table_open string = `<table id="query-result" class="min-w-full divide-y divide-gray-200">` const table_open string = `<table id="query-result" class="min-w-full divide-y divide-gray-200">`
@ -52,11 +54,7 @@ func generateRow(cols []string, data map[string]interface{}) string {
row := "<tr>" row := "<tr>"
for _, col := range cols { for _, col := range cols {
str, ok := data[col].(string) row += fmt.Sprintf(table_body_row, data[col])
if !ok {
str = "NULL"
}
row += fmt.Sprintf(table_body_row, str)
} }
return row + "</tr>" return row + "</tr>"