So I have this slice
UserIDs: []string{"A1", "A2", "A3", "B1", "B2", "C1", "C2", "C3", "C4"}
And I have this table in my HTML template
<table>
<tr>
<td>User role: </td>
<td><span class="italic alignright">{{.ObjectMap.UserRole}}</span></td>
</tr>
<tr>
<td>User ID's: </td>
{{range $k, $v := .UserIDs}}
<td><span class="italic alignright">{{.}}</span></td>
{{end}}
</tr>
</table>
I would like to print “User ID’s” in one column and then in the column adjacent I’d like the list:
A1
A2
A3
B1
B2
C1
C2
C3
C4
Also the cell size must change depending on the number of User ID’s.
How do I go about this, I was thinking inside the range function but I have no Idea where to start, thanks.