2

当我在表格单元格中嵌入 SVG(内联 XML)时,无论我尝试什么,SVG 图像的溢出部分都被隐藏了。我想在多个单元格中使用 SVG 并使用透明背景来实现这样的效果,其中图形跨越多个单元格。

例子

表格形式在这里最合适:其他数据(未显示)将在其他列中。

起点jsfiddle:http: //jsfiddle.net/ApWTS/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
</head>
<body>
<table>
<tr>
<td style="width:200px;height:100px;background-color: red;">top cell</td>
</tr>
<tr>
<td style="width:200px;height:100px;background-color: yellow;overflow:visible;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <circle cx="100" cy="50" r="80" stroke="black" stroke-width="2" fill="red"/>
</svg>
</td>
</tr>
<tr>
<td style="width:200px;height:100px;background-color: green;">bottom cell</td>
</tr>
</table>
</body>
</html>
4

1 回答 1

5

尝试给 svgs anabsolute position和单元格 arelative positionoverflow: visible

于 2012-09-18T22:38:38.003 回答