jrzelling jrzelling - 9 months ago 39
R Question

How can I make a table inside my shiny box with RandomIcon()

My shiny app has a box that looks like this:

enter image description here

But the inside UI code is just:

enter image description here

I want to render a table inside of the box instead that looks like this:

enter image description here

Where the random icon is generated from a function RandomIcon(). I've tried all morning to render a table inside and can't figure out how to make the table inside the box.

I didn't have trouble when I was using the server code for renderInfoBox but now I'm using box:

enter image description here

How can I render the table inside the box? PS don't downvote stackoverlow wants to ban me.


Will the table be dynamic in size, or will it always have the same number of rows/columns? If the former, you'd need to use renderUI to render your table server-size, then call it with uiOutput on the ui side. If the latter, then you could use HTML() and the <table>, <th>, <tr>, and <td> HTML tags to manually create your table. Then, each icon and each data source value (if dynamic), would need to be created server side, and called in the ui individually. renderUI and uiOutput seem to be your best bet.