weiß jemand wie man innerhalb einer Zelle, den Text vertikal sowie horizontal mittig ausrichten kann?
Vertikal bekomme ich hin, in dem man auf die Spalte auf center einstellt.
Aber wie bekomme ich die horizontale, mittige Ausrichtung hin?
Durch das Einfärben wird es offensichtlich, dass der Text nicht mittig steht.
Vielen Dank für eure Hilfe!
Anbei ein Minimalbeispiel:
\documentclass[% 12pt, ngerman, a4paper, ]{scrbook} \usepackage{tabularx} \usepackage{array} \usepackage{booktabs} % nicer tables \usepackage{rotating} \newcommand\tabrotate[1]{\begin{turn}{90}\rlap{#1}\end{turn}} \usepackage{varwidth} \newcommand\tabvarwidth[2][3cm]{\begin{varwidth}[b]{#1}\centering #2\end{varwidth}} \usepackage{colortbl} \begin{document} \begin{tabular}{lc|cccccccccc|cc} \\ \\ \\ \\ \\ \\ && \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z}& \tabrotate{z} & & \\ \bfseries u && 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & \bfseries{$\sum$} & \bfseries x\\ \midrule x & 1 & \cellcolor{blue}1 & 0 & 2 & 2 & 0 & 2 & 2 & 2 & 0 & 2 & 13 & 13\\ x & 2 & 2 & \cellcolor{blue}1 & 2 & 2 & 0 & 1 & 2 & 2 & 2 & 2 & 16 & 16\\ x & 3 & 0 & 0 & \cellcolor{blue}1 & 2 & 0 & 1 & 1 & 2 & 0 & 2 & 9 & 9\\ x & 4 & 0 & 0 & 0 & \cellcolor{blue}1 & 0 & 0 & 0 & 2 & 0 & 0 & 3 & 3\\ x & 5 & 2 & 2 & 2 & 2 & \cellcolor{blue}1 & 2 & 2 & 2 & 2 & 2 & 19 & 19\\ x & 6 & 0 & 1 & 1 & 2 & 0 & \cellcolor{blue}1 & 2 & 2 & 0 & 2 & 11 & 11\\ x & 7 & 0 & 0 & 1 & 2 & 0 & 0 & \cellcolor{blue}1 & 2 & 0 & 0 & 6 & 6\\ x & 8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \cellcolor{blue}1 & 0 & 0 & 1 & 1\\ x & 9 & 2 & 0 & 2 & 2 & 0 & 2 & 2 & 2 & \cellcolor{blue}1 & 2 & 15 & 15\\ x & 10 & 0 & 0 & 0 & 2 & 0 & 0 & 2 & 2 & 0 & \cellcolor{blue}1 & 7 & 7\\ \midrule & & & & & & & & & & & & & \\ \end{tabular} \end{document}