1<svg xmlns="http://www.w3.org/2000/svg">
2 <script><![CDATA[
3 var xhtml_ns = "http://www.w3.org/1999/xhtml";
4 var root = document.documentElement;
5
6 var foreignObject = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
7 foreignObject.setAttribute("x", "10");
8 foreignObject.setAttribute("width", "200");
9 foreignObject.setAttribute("height", "100");
10 root.appendChild(foreignObject);
11
12 var log = document.createElementNS(xhtml_ns, "div");
13 foreignObject.appendChild(log);
14
15 var html =
16 "<h2>Header</h2>" +
17 "<table style='border: 1px solid black;'>" +
18 "<thead>" +
19 "<tr>" +
20 "<th>Cell 1</th>" +
21 "<th>Cell 2</th>" +
22 "<th>Cell 3</th>" +
23 "</tr>" +
24 "</thead>" +
25 "</table>";
26
27 log.innerHTML = html;
28 ]]></script>
29</svg>