Here's one hack that would do it, if you are using LaTeX input.
$$
\def\S{\kern .5em}
\def\top#1{\rlap{\raise1.5em{\underline{\S\, #1\S\,\mathstrut}}}}
\def\row#1#2{\phantom{\S#1 00}\llap{#2}}
\def\urow#1#2{\row{#1}{\underline{\S#2\S\mathstrut}}}
\def\rows#1#2#3{\row{#1}{#2\S}\\\urow{#1}{#3}\\}
\frac{1}{8}=
\begin{array}[t]{l}
\top{0{,}125}
\rows{-}{1\rlap{{}:8}}{-0}
\rows{-0}{10}{-8}
\rows{-00}{20}{-16}
\rows{-000}{40}{-40}
\row{-00}{==}
\end{array}
$$
The first argument to the \rows, \urow, and \row macros is an indentation amount, and the second (and third) are the contents of the various rows. You don't need to provide the definitions more than once, as long as they are done before the first array that uses them. You could add these to your MathJax configuration using the tex.macros object, if you wanted to have them available all the time (though they would have to be converted to the proper format for that).
Davide