1

I was wondering how one could use multirow without centering the cell entry vertically. Since I haven't found any questions regarding this, might you please help?

On my way there, I discovered multiple further problems as can be seen in my MWE:

Why does multirow command not work at all in my MWE? What did I miss?

How do I manage line breaks within the first word in a tabular cell? Neither p columns nor P columns (with arraybackslash) seem to work here.

What about that first capital letter getting misplaced? How can one avoid this?

\documentclass[a4paper]{article}

% Based on the class scrreprt by "KOMA-Script", whatever that means. If that doesn't help, please try \documentclass{scrreprt} or one of the usual.
\usepackage[T1]{fontenc}

\usepackage[ngerman]{babel}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}

\newcolumntype{P}[1]{>{\raggedright\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{x}{>{\raggedright\arraybackslash\hspace{0pt}}X}

\begin{document}

\begin{table}[htb] 
\centering
\setlength{\tabcolsep}{4mm}
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\textwidth}{|P{6em}|x|P{6em}|}
\hline
\multirow{3}{*} Kommunizierbarkeit & Verständlichkeit und Vermittelbarkeit des Programms für Mitarbeiter und Fahrgäste & \multirow{3}{*} Mitarbeiterbefragung, Fahrgastbefragung, Anzahl der Geschäftsvorfälle in XYZ bzw. an der Schnittstelle ABCD / XYZ \\
& Möglichkeit der Komplexitätsreduktion hinsichtlich der Anweisungen und Informationen für Mitarbeiter und Fahrgäste & \\
& Kommunizierbarkeit der Lösungen & \\\hline
\end{tabularx}
\end{table}

\end{document}

enter image description here

2
  1. The newest version of multirow has an optional first argument that specifies the vertical alignment.
  2. You must enclose the text of a \multirow cell in braces {}.
  3. TeX doesn't hyphenate the first word of a paragraph. Add \hspace{0pt} in front of it (without intervening spaces) to get the word hyphenated or add manual hyphenation points. 'Kommunizierbarkeit' isn't hyphenated anyway in my LaTeX. Also with {*} you don't get linebreaking at all. Use {=} with the new multirow version.
  4. The capital letter: see 2.

Table code:

 \begin{tabularx}{\textwidth}{|P{6em}|x|P{6em}|}
  \hline
  \multirow[t]{3}{=}{\hspace{0pt}Kommuni\-zier\-bar\-keit} 
    & Verständlichkeit und Vermittelbarkeit des Programms
      für Mitarbeiter und Fahrgäste 
    & \multirow[t]{3}{=}{\hspace{0pt}Mitarbeiterbefragung, 
      Fahrgastbefragung, Anzahl der Geschäftsvorfälle in XYZ
      bzw. an der Schnittstelle ABCD / XYZ} \\
    & Möglichkeit der Komplexitätsreduktion hinsichtlich
      der Anweisungen und Informationen
      für Mitarbeiter und Fahrgäste & \\
    & Kommunizierbarkeit der Lösungen & \\
  \hline
\end{tabularx}

Result

As you can see the third column overflows. Make it a bit wider (e.g. 7em) or add an empty row at the end of the table.

  • Thank you for your quick response, that already helped a lot! What package am I missing when adding "[t]" or substituting "*" for "=" leads to the error "! Missing number, treated as zero."? – D. Duesen Nov 9 '16 at 17:24
  • Bonus question: Can I make this into a longtable without relinquishing the command lines \centering \setlength{\tabcolsep}{4mm} \renewcommand{\arraystretch}{1.5}? – D. Duesen Nov 9 '16 at 17:28
  • 1
    You just need multirow version 2.1. – Piet van Oostrum Nov 9 '16 at 18:17
  • 1
    If your TeX system has a package manager then doing an update should get you the newest version. Otherwise get it from ctan.org/pkg/multirow and install it in a directory where TeX can find it. For example in the directory where your document is. But using the package manager is the best solution. – Piet van Oostrum Nov 10 '16 at 12:20
  • 1
    multirow.ins is part of what you download from CTAN, together with multirow.dtx. Put them in a directory, and then run tex multirow.ins or latex multirow.ins in that directory (using a command line). If you are not familiar with the command line, then maybe you can use your favourite TeX editor/processor, which probably also will work. You can also download a ready-made multirow.sty from http://mirror.ctan.org/systems/texlive/tlnet/archive/multirow.tar.xz, maybe that's easier. But you should find out why your package manager can't do it, as regularly updating your TeX system helps – Piet van Oostrum Nov 10 '16 at 13:44
2

Pairs of braces were missing for the last argument of \multirow. The last but one argument should be set to \linewidth (which is the width of the current column). Finally, you can obtain a correct layout enlarging the left and right columns, and letting \tabcolsep have its default value (6pt), and adding only a small adjustment of the position of the multirow contents.

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} % Based on the class scrreprt by "KOMA-Script", whatever that means. If that doesn't help, please try \documentclass{scrreprt} or one of the usual.
\usepackage[T1]{fontenc}
\usepackage{lmodern}%
\usepackage[showframe]{geometry} %
\usepackage[ngerman]{babel}
\usepackage{ragged2e}%
 \usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}

\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash\leavevmode}p{#1}}
\newcolumntype{x}{>{\RaggedRight\arraybackslash\leavevmode}X}

\begin{document}

\begin{table}[htb]
\centering
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\textwidth}{|P{9.6em}|x|P{9.6em}|}
\hline
Kommunizierbarkeit & Verständlichkeit und Vermittelbarkeit des Programms für Mitarbeiter und Fahrgäste & \multirow{5}{\linewidth}[-1.2pt]{Mitarbeiterbefragung, Fahrgastbefragung, Anzahl der Geschäftsvorfälle in XYZ bzw. an der Schnittstelle ABCD / XYZ} \\
& Möglichkeit der Komplexitätsreduktion hinsichtlich der Anweisungen und Informationen für Mitarbeiter und Fahrgäste & \\
& Kommunizierbarkeit der Lösungen & \\\hline
\end{tabularx}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.