Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            - /mathml/tables/tablespacing-4.html - WPT Dashboard Interop Dashboard
 
<!DOCTYPE html>
<html class="reftest-wait">
  <head>
    <title>Dynamic tests involving adding and removing elements</title>
    <meta charset="utf-8"/>
    <link rel="match" href="tablespacing-4-ref.html"/>
  </head>
  <body>
  <math>
    <mtable columnspacing="5em 7em" id="mtable0a">
      <mtr id="mtr0">
        <mtd>
          <mn>x</mn>
        </mtd>
        <mtd>
          <mn>y</mn>
        </mtd>
      </mtr>
    </mtable>
  </math>
  <p>
  <math>
    <mtable  columnspacing="5em 7em">
      <mtr id="mtr0a">
        <mtd>
          <mn>x</mn>
        </mtd>
        <mtd id="mtd0">
          <mn>y</mn>
        </mtd>
        <mtd>
          <mn>z</mn>
        </mtd>
      </mtr>
    </mtable>
  </math>
  <p>
  <math>
    <mtable rowspacing="2ex 4ex" id="mtable0">
      <mtr>
        <mtd>
          <mn>x</mn>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <mn>y</mn>
        </mtd>
      </mtr>
    </mtable>
  </math>
  <p>
  <math>
    <mtable  rowspacing="2ex 4ex" id="mtable1">
      <mtr>
        <mtd>
          <mn>x</mn>
        </mtd>
      </mtr>
      <mtr id="mtr1">
        <mtd>
          <mn>y</mn>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <mn>z</mn>
        </mtd>
      </mtr>
    </mtable>
  </math>
  <p>
  <math>
    <mtable  rowspacing="2ex 4ex" columnspacing="4em">
      <mtr id="mtr2">
        <mtd>
          <mn>x</mn>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <mn>y</mn>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <mn>z</mn>
        </mtd>
      </mtr>
    </mtable>
  </math>
  <script>
    function doTest() {
      // Add a table cell
      mn0.innerHTML = 'z';
      mtd0.appendChild(mn0);
      document.getElementById("mtr0").appendChild(mtd0);
      // Remove a table cell
      document.getElementById("mtr0a").removeChild(document.getElementById("mtd0"));
      // Add a table row
      mn1.innerHTML = 'z';
      mtd1.appendChild(mn1);
      mtr1.appendChild(mtd1);
      document.getElementById("mtable0").appendChild(mtr1);
      // Remove a table row
      document.getElementById("mtable1").removeChild(document.getElementById("mtr1"));
      // Add a table cell to a table containing several rows
      mn2.innerHTML = 'w';
      mtd2.appendChild(mn2);
      document.getElementById("mtr2").appendChild(mtd2);
      document.documentElement.removeAttribute("class");
    }
    document.documentElement.addEventListener("TestRendered", doTest);
  </script>
  </body>
</html>