Send an email with dataframe as a flextable

允我心安 提交于 2019-12-02 12:50:39

This is because print method is displaying the flextable, it does not return the HTML value. The method format(fletable_obj, type = "HTML") return the HTML value.

You should modify the HTML creation as:

msgJP <- try(mime_part(paste('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>HTML demo</title>
<style type="text/css">
</style>
</head>  
<body>',"hello,<br>","check out the data for self audit.","<br>",
format(flextable(samplemondata), type = "html"),
'</body>
</html>')))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!