[techexplorer-support] mtable problem

Aleksey news4al at freemail.ru
Wed Jul 27 02:50:14 MDT 2005


Hello Sam,

Initially I have a table with 1 row and 1 column. Then I add 2 cells
in that row. And then I clone that row in order to have 3x4 table.
But after updating math I can see only initial cell. The rest cells
are not displaying.

  Please see the following code:
  ------------------------------------------------------
<html xmlns:m>
<head>
<object name="mml" classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4"></object>
<?import namespace="m" implementation="#mml" ?>
<title>Integre Techexplorer Testbed</title>
<script language="JavaScript" type="text/javascript">
function handleClick() 
{
        var mt = document.getElementById("mtable");
        table = mt.firstChild;
        
        var r = table.firstChild; // get tr node
        var td = r.firstChild;    // get td node
        
        for (var col=1; col < 3; col++) {
                var cell = td.cloneNode(true);
                r.appendChild(cell);
        }
        
        for (var row =1; row < 4; row++) {
                var tr = r.cloneNode(true);
                table.appendChild(tr);
        }
        
        mt.validateMml();
        //alert(mt.innerHTML);
}
</script>
</head>
<body>
<h2>Scripting</h2>
<div style="border:dotted;">

<m:math id="mtable">
<m:mtable><m:mtr>
<m:mtd><m:mn>0</m:mn></m:mtd>
</m:mtr></m:mtable>
</m:math>

</div>
<p><form>
    <input type="button" value="Show Matrix" onclick="handleClick()">
</form></p>
</body>
</html>
  ------------------------------------------------------

If you uncomment alert in the last line of function you can see that
table has 12 cells, but only the first of them is displayed.

What I do wrong? How can I workaround that?

Thanks in advance.


-- 
Best regards,
 Aleksey                          mailto:news4al at freemail.ru




More information about the techexplorer-support mailing list