I have a string slice, I'd like to range through the slice and create a simple HTML table with the values. This is some sample code to illustrate:
var tmpl = `<td>%s</td>`
names := []string{"john", "jim"}
for _, v := range names {
fmt.Printf(tmpl, v)
}
This produces:
I'd like to take what's returned and create a HTML table or at least be able to pass it to another HTML template that has the table structure. Any ideas how this can be done?
</div>