Source TeX:
\begin{array}{rl}{{x^3} + 8}&{\left| {\underline {x + 2} } \right. }\\{\underline {- \left( {{x^3} + 2{x^2}} \right)} }&{ \; {x^2} - 2x + 4}\\{-2{x^2} + 8}&{}\\{\underline {-\left( {-2{x^2} - 4x} \right)}}&{}\\{4x+8}&{}\\{\underline {-\left( {4x + 8} \right)}}&{} \\{0}&{}\end{array}