在SVG中创建一个表 [英] Create a table in SVG
问题描述
我正在尝试在SVG文档中创建一个表状对象。目前,由于SVG没有表格元素,我正在使用HTML解析器将HTML表(由HTML表生成器中的用户创建)转换为一组SVG对象,并且然后添加到我的SVG总图。我想知道有没有人能够找到一个更好的替代方法,如SVG表生成器?我正在使用Javascript或jquery来完成这个任务。任何想法或建议将不胜感激。
I'm trying to create a table-like object within an SVG document. Currently, due to the fact that SVG does not have a table element, I am using an HTML parser to go through and convert an HTML table, (created by the user in an HTML table Builder), to a group of SVG objects, and then adding that to my overall SVG drawing. I was wondering if any one was able to find a better alternative to this method, such as an SVG table builder? I'm looking to accomplish this using Javascript or jquery. Any ideas or suggestions would be appreciated.
推荐答案
我只需在SVG中嵌入一个真实的表:
I would simply embed a real table in my SVG:
<?xml version="1.0" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg">
<foreignObject x="10" y="10" width="100" height="150">
<body xmlns="http://www.w3.org/1999/xhtml">
<table><!-- ... --></table>
</body>
</foreignObject>
<!-- ... -->
</svg>
这篇关于在SVG中创建一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!