MCPcopy Create free account
hub / github.com/RiotGames/developer-relations / structToHTML

Function structToHTML

sample_apps/rso_sample_apps/go/main.go:183–218  ·  view source on GitHub ↗
(data map[string]string)

Source from the content-addressed store, hash-verified

181}
182
183func structToHTML(data map[string]string) (string, error) {
184 style := `
185 <style type="text/css">
186.tg {border-collapse:collapse;border-spacing:0;}
187.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
188overflow:hidden;padding:10px 5px;word-break:normal;}
189.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
190font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
191.tg .tg-0lax{text-align:left;vertical-align:top}
192</style>`
193 html := `
194 <table class="tg">
195 <thead>
196 <tr>
197 <th class="tg-0lax">key</th>
198 <th class="tg-0lax">value</th>
199 </tr>
200 </thead>
201
202 <tbody>`
203
204 for key, value := range data {
205 html += fmt.Sprintf(`
206 <tr>
207 <td class="tg-0lax">%s</td>
208 <td class="tg-0lax">%s<br></td>
209 </tr>`, key, value)
210 }
211
212 html += `
213 </tbody>
214 </table>
215 `
216
217 return style + html, nil
218}
219
220func main() {
221 loadConfig()

Callers 2

getAccountDataFunction · 0.85
getChampionRotationDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected