在R Shiny的标题面板中显示表格

时间:2017-01-19 11:05:54

标签: r shiny

我需要在R Shiny上的titlePanel中并排显示2个表格

喜欢的东西

titlePanel(
    #This is the heading
    "Animal Features",
    # Then I need to display a table, something like
#     "Animal",                  "Animal Type",                         
#     "Tiger",                  "Mammal"    ,                       
#     "Tuna",                   "Fish",                         
#     "Eagle",                  "Bird"          

#then next to it I need to display another table unconnected to the previous one, something like

#     "Eating Habits",        "Eats",                       
#     "Omnivore",             "Everything", ,                       
#     "Carnovore",            "Meat",                           
#     "Herbivore",             "Vegetables" 
)

但是,到目前为止我尝试的所有内容都使它显示为纯文本。

1 个答案:

答案 0 :(得分:0)

这可能是一个解决方案吗?

titlePanel(HTML("<div style='float:right;'>Old Faithful Geyser Data</div>
                   <div style='font-size:12px; float:left;'><table><tr><td>bla</td><td>bla</td></tr><tr><td>bla</td><td>bla</td></tr></table></div>
                   <div><table><tr><td>bla1</td><td>bla2</td></tr><tr><td>bla3</td><td>bla4</td></tr></table></div>"))

肮脏的黑客但它似乎有用。