当我将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>

最佳答案

试着给svgs一个absolute position和细胞一个relative positionoverflow: visible

09-30 15:55
查看更多