I'm trying to make/ print/ show table with Shiny R using for loop, however my for loop doesn't return HTML. Could you help me to find out what's wrong with my for loop? Thank you in advance!
div(style="font-size: 9pt; font-family:calibri;",
tags$table(
tags$caption("Market Split"),
tags$tr(
tags$th(names(dpe1)[1]),
tags$th(names(dpe1)[2])
),
for (i in 1:nrow(dpe1)){
tags$tr(
tags$td(dpe1[i,1]),
tags$td(dpe1[i,2])
)}
))
as a result:
<div style="font-size: 9pt; font-family:calibri;">
<table>
<caption>Market Split</caption>
<tr>
<th>Planning.Area</th>
<th>Reporting.Country</th>
</tr>
</table>
</div>