Use "mtable" for Linebreaking and Indentation

Q

How to use <mtable> tag a workaround to force linebreaks and indentations?

✍: FYIcenter.com

A

<mtable> tags are good solutions to control line breaks, indentations and alignments.

Here is a good example of using <mtable> to display a multi-line formula with comments:

<math display="block">
<mtable columnspacing="0.1in" columnalign="left">
  <mtr>
    <mtd><mi>y</mi></mtd>
    <mtd><mo>=</mo></mtd>
    <mtd> <mfrac>
      <mrow> <msup><mi>x</mi><mn>2</mn></msup> <mo>&#x2212;</mo> <mn>4</mn> </mrow>
      <mrow> <mi>x</mi><mo>&#x2212;</mo><mn>2</mn> </mrow>
    </mfrac> </mtd>
    <mtd><mtext>where</mtext><mspace width="0.3em"/>
      <mi>x</mi><mo>&#x2260;</mo><mn>2</mn></mtd>
  </mtr> <mtr>
    <mtd></mtd>
    <mtd><mo>=</mo></mtd>
    <mtd> <mfrac>
      <mrow>
        <mo>(</mo> <mi>x</mi><mo>+</mo><mn>2</mn> <mo>)</mo> <mo>&#x2062;</mo>
        <mo>(</mo> <mi>x</mi><mo>&#x2212;</mo><mn>2</mn> <mo>)</mo>
      </mrow>
      <mrow> <mi>x</mi><mo>&#x2212;</mo><mn>2</mn> </mrow>
    </mfrac> </mtd>
    <mtd><mtext>factoring</mtext><mspace width="0.3em"/>
      <msup><mi>x</mi><mn>2</mn></msup> <mo>&#x2212;</mo> <mn>4</mn></mtd>
  </mtr> <mtr>
    <mtd></mtd>
    <mtd><mo>=</mo></mtd>
    <mtd><mi>x</mi><mo>+</mo><mn>2</mn></mtd>
    <mtd><mtext>cancelling</mtext><mspace width="0.3em"/>
      <mi>x</mi><mo>&#x2212;</mo><mn>2</mn></mtd>
  </mtr>
</mtable>
</math>

y = x2 − 4 x−2 where x≠2 = ( x+2 ) ⁢ ( x−2 ) x−2 factoring x2 − 4 = x+2 cancelling x−2

 

⇒ Use "columnwidth" for Cross Formula Alignment

⇐ Forced Linebreaking on "mspace" Tags

⇑ Alignment, Indentation and Line Breaks

⇑⇑ MathML (Mathematical Markup Language)

2026-10-17, ∼1778🔥, 0💬