Consider the following example:
\documentclass[
a4paper,
12pt
]{article}
\usepackage{ragged2e,array}
\usepackage{xfp}
\def\mlr{1.2}
\newcommand*\saenk[1]{\raisebox{\fpeval{-0.5*\mlr}ex}{#1}}
\newcommand*\mc[3]{\multicolumn{#1}{#2}{\saenk{\textbf{#3}}}}
\begin{document}
\begin{center}
\Large
\begin{tabular}{
|>{\RaggedLeft\arraybackslash}m{0.7cm}
|>{\centering\arraybackslash}m{6cm}
|>{\centering\arraybackslash}m{3cm}|
}
\hline \mc{2}{|c}{Opgave} & \mc{1}{|c|}{Facit} \\[\mlr ex]
\hline 1. & $3x - 7 = 2$ & \saenk{$x = 3$} \\[\mlr ex]
\hline 2. & $10 = 7 + x \div 4$ & \saenk{$x = 12$} \\[\mlr ex]
\hline 3. & $2x - 5 = 9$ & \saenk{$x = 7$} \\[\mlr ex]
\hline 4. & $2x + 5 = 3x + 9$ & \saenk{$x = -4$} \\[\mlr ex]
\hline 5. & $7x - 22 = x + 8$ & \saenk{$x = 5$} \\[\mlr ex]
\hline 6. & $24x - 16 = 32$ & \saenk{$x = 2$} \\[\mlr ex]
\hline 7. & $3x + 18 = 12$ & \saenk{$x = -2$} \\[\mlr ex]
\hline 8. & $18 = 2x + 8$ & \saenk{$x = 5$} \\[\mlr ex]
\hline 9. & $3x + 100 = 250$ & \saenk{$x = 50$} \\[\mlr ex]
\hline 10. & $21 = 4x + 9$ & \saenk{$x = 3$} \\[\mlr ex]
\hline 11. & $4x - 10 + 2x = 4x$ & \saenk{$x = 5$} \\[\mlr ex]
\hline 12. & $2x - 5 = 9$ & \saenk{$x = 7$} \\[\mlr ex]
\hline
\end{tabular}
\end{center}
\end{document}
How do I automatcailly align the expressions in both the second and third column at the =
s?
\saenk
doesn't seem necessary. Or rather, why do you use it?:-)
The text is then no longer vertically center inside the cell.