0

This is my example: ignore the German text.

\documentclass[a4paper,11pt]{article}
\usepackage[left=3cm, right=4cm, top=2cm, bottom=2cm]{geometry}
\usepackage{array}
\usepackage{tabularx}
\usepackage{indentfirst}
\newcommand{\rtab}{\raggedleft\arraybackslash}


\begin{document}

\begin{tabular}{|>{\raggedleft}p{3cm}|m{1cm}|m{4cm}|m{1.2cm}|m{0.6cm}|m{1.2cm}|} 
\hline 
\multicolumn{0}{|m{3cm}|}{\rule{0pt}{0.8cm}\textbf{Bewertung}} & Note & Notenstufe in Worten & Punkte &   & Punkte \\ 
\hline 
\multicolumn{0}{|m{3cm}|}{\rule{0pt}{0.8cm}schriftliche Arbeit} &   &   &   & x 3 &   \\ 
\hline 
\multicolumn{0}{|m{4cm}|}{\rule{0pt}{0.8cm}Abschlusspr\"asentation} &   &   &   & x 1 &   \\ 
\hline
\multicolumn{5}{m{10cm}|}{\rule{0pt}{0.8cm}Summe:} &    \\ 
\cline{6-6}
\multicolumn{5}{m{10cm}|}{\rule{0pt}{0.9cm}Gesamtleistung nach \S 61 (7) GSO = Summe: \textbf{2} (gerundet)}  &   \\ 
\cline{6-6}
\end{tabular} 
\end{document}

I want all text to be centered vertically, but I want to chose the horizontal alignment:

The first column should be aligned to the left, except for the last to rows, where the text should be aligned to the right. I hope you can help me as quick as possible.

Thank You.

1 Answer 1

1

It is not clear what you were trying to do. Especially \multicolum{0).

\documentclass[a4paper,11pt]{article}
\usepackage[left=3cm, right=4cm, top=2cm, bottom=2cm, showframe]{geometry}
\usepackage{array}
\usepackage{tabularx}
\usepackage{indentfirst}
\newcommand{\rtab}{\raggedleft\arraybackslash}
\newcommand{\cstrut}[1]% #1 = strut height
 {\raisebox{\dimexpr \dp\strutbox-0.5\height}{\rule{0pt}{#1}}}


\begin{document}
\null\vfil\noindent\hfil
\begin{tabular}{|p{3cm}|m{1cm}|m{4cm}|m{1.2cm}|m{0.6cm}|m{1.2cm}|} 
\hline 
\cstrut{0.8cm}\hfill\textbf{Bewertung} & Note & Notenstufe in Worten & Punkte &   & Punkte \\ 
\hline 
\cstrut{0.8cm}schriftliche Arbeit &   &   &   & x 3 &   \\ 
\hline 
\cstrut{0.8cm}Abschlusspr\"asent\-ation &   &   &   & x 1 &   \\ 
\hline
\multicolumn{5}{m{10cm}|}{\cstrut{0.8cm}\hfill Summe:} &    \\ 
\cline{6-6}
\multicolumn{5}{m{10cm}|}{\cstrut{0.9cm}\hfill Gesamtleistung nach \S 61 (7) GSO = Summe: \textbf{2} (gerundet)}  &   \\ 
\cline{6-6}
\end{tabular} 
\end{document}
2
  • That was my last version. but if 0 is changed to 1 nothing changed, I don't know why. I just want to have a tabular, where every column and row is vertically centered. Oct 19, 2018 at 20:35
  • I suspect any number less than 1 is converted to 1, it was just a strange concept. The problem with using a strut inside a p or m column is that it interferes with the second line (if there is more than one). Oct 20, 2018 at 3:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .