html - 在 R 中粘贴 HTML 文本
问题描述
我正在尝试粘贴 HTML 值,如下所示。输出很好。但是我们也可以用另一种方式来做到这一点。我试过(参考 B 节)我将变量传递到 HTML
Section A
tags$div(style = "background-color:#cbe6ef;padding:5em",tags$table(tags$thead(tags$tr(tags$th("Number of Reviews","d")))))
<div style="background-color:#cbe6ef;padding:5em">
<table>
<thead>
<tr>
<th>
Number of Reviews
d
</th>
</tr>
</thead>
</table>
</div>
B节
as1 <- tags$table(tags$thead(tags$tr(tags$th("Number of Reviews","New"))))
tags$div(style = "background-color:#cbe6ef;padding:5em",HTML(paste("dis(\"",as1,"\")")))
<div style="background-color:#cbe6ef;padding:5em">dis(" <table>
<thead>
<tr>
<th>
Number of Reviews
New
</th>
</tr>
</thead>
</table> ")</div>
但是A部分的输出不一样。我们可以使输出类似于A部分吗?
解决方案
推荐阅读
- python - 为什么 groupby 数据框在应用 quantile 函数后变成一个系列?
- python - Running video in Python using VLC and PyQt doesn't start
- android - 如何设置fragment的按钮关闭activity?
- python - 如何在 django 中填充用户特定的数据
- android - Android PreferenceFragmentCompat、首选项标题和摘要未显示
- python - 连接失败后恢复 SFTP 下载(pysftp / paramiko)
- spring-boot - system_cpu_usage 值远低于预期
- c# - 在数组的整数元素中搜索一个数字
- r - 使用 apply 函数更新外部范围变量
- common-lisp - Common Lisp:如何在读取函数中选择符号所属的包