PHPExcel在mysql表行中渲染html标记 [英] PHPExcel Render html tags in mysql table row

查看:225
本文介绍了PHPExcel在mysql表行中渲染html标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 phpExcel 库。我有一个导出脚本工作正常,从MySQL表中获取所有数据。一个名为 product_info 的行,其中包含HTML标签和样式。

I am using phpExcel library.I have an export script working fine which fetch all data from a MySQL table.Now the MySQL table has a row called product_info which contains HTML tags and styles.

现在如何渲染这些样式行,其中包含< font color =Red> Hello< / font> 等HTML元素。此HTML标签不同。

Now how can I render those styles for that just one row, which contain HTML elements like <font color="Red">Hello</font>. This HTML tags varies. So how can I render them?

请告知

推荐答案

不能。您可以解析HTML标记并使用它来构建一个富文本对象,然后可以将其设置为单元格的内容;但是没有从HTML到PHPExcel本身内置的富文本转换,所以你需要手工完成。

You can't. You could parse the HTML markup and use it to build a rich text object, that you could then set as the content of a cell; but there is no conversion from HTML to rich text built into PHPExcel itself, so you'd need to do that by hand.

这篇关于PHPExcel在mysql表行中渲染html标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆