1

I would like to create a table with a specific column width and an automatic linebreak in my multirow columns.

THANKS to Elad Den for my progress. :)

Is it possible to automatically set the width of these columns to fill the DINA4 paper and how is it possible to center Fabrikobjekte and (B) (O) and (R)?

This picture is how it should look like. Its not important to have these bullet points.

This is how it should look like

And this is my current code.

\usepackage{graphicx,multirow,tabularx}
\usepackage{array,calc}
\usepackage{booktabs}
\usepackage{geometry}

\begin{table}
\centering
\caption{Gestaltungsfelder}
\begin{tabular}{|c|c|c|c|}
    \cline{2-4}    
    \multicolumn{1}{r|}{} & \multicolumn{3}{c|}{Gestaltungsfelder} \\
    \cline{2-4}    
    \multicolumn{1}{r|}{} & \multicolumn{1}{m{5cm}|}{Betriebsmittel (B)} & \multicolumn{1}{m{5cm}|}{Organisation (O)} & \multicolumn{1}{m{5cm}|}{Raum- und  Gebäudetechnik (R)} \\
    \hline
    \multirow{8}{*}{\rotatebox{90}{Fabrikobjekte}}
    & {\parbox{5cm}{Fertigungseinrichtung}}   & {\parbox{5cm}{Unternehmensstrategie}}     & {\parbox{5cm}{Grundstück}} \\
    & {\parbox{5cm}{Montageeinrichtungen}}     & {\parbox{5cm}{Logistikkonzept}}     & {\parbox{5cm}{Baukonstruktion}} \\
    & {\parbox{5cm}{Logistikeinrichtungen}}     & {\parbox{5cm}{Prozessgestaltung}}     & {\parbox{5cm}{Technische Anlagen}} \\
    & {\parbox{5cm}{Qualitätseinrichtungen}}     & {\parbox{5cm}{Aufbauorganisationsgestaltung}}     & {\parbox{5cm}{Außenanlagen}} \\
    & {\parbox{5cm}{Informations- und Kommunikationseinrichtungen}}     & {\parbox{5cm}{Arbeitsorganisation}}     & {\parbox{5cm}{Ausstattung}} \\
    & {\parbox{5cm}{Ver- und Entsorgungseinrichtungen}}     & {\parbox{5cm}{Qualitätssicherungs-konzept}}     & {\parbox{5cm}{Konzepte}} \\
    & {\parbox{5cm}{Übergeordnete Systeme}}     &       &  \\
    & {\parbox{5cm}{Mobiliar}}     &       &  \\
    \hline
\end{tabular}%
\label{tab:addlabel}%
\end{table}%

New solution: Thank you very much for helping me Bernard!!!

enter image description here

Paul
  • 47

1 Answers1

2

Here is a solution with tabularx and enumitem:

\documentclass[a4paper, ngerman]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[showframe]{geometry}
\usepackage[table, svgnames]{xcolor}
\usepackage{ragged2e}
\usepackage{tabularx, multirow, caption, makecell, hhline}
\usepackage{graphicx}
\usepackage{enumitem}

\begin{document}

\begin{table}[!htbp]
  \centering
  \setlength\tabcolsep{3pt}
  \setlist[itemize]{wide=0pt, labelsep=2pt, leftmargin=*, nosep, before =\mbox{}\vspace*{-.7\baselineskip}, after=\vspace*{-.8\baselineskip}}
  \caption{Gestaltungsfelder}
  \begin{tabularx}{\textwidth}{|c|*{2}{>{\RaggedRight}X|}p{3.3cm}|}
    \hhline{~|---|}
    \multicolumn{1}{r|}{} & \multicolumn{3}{c|}{\cellcolor{Gainsboro}Gestaltungsfelder} \\
    \hhline{~|---|}
    \rowcolor{Gainsboro} \multicolumn{1}{r|}{\cellcolor{white}} & % \multicolumn{1}{>{\centering}X}{\centering Betriebsmittel\newline \centering (B)}
    \makecell{Betriebsmittel \\ (B)} & \makecell{Organisation\\ (O)} & \makecell{Raum- und \\Gebäudetechnik \\ (R)}\\
    \hline
    \multirow{10}{*}[-1ex]{\rotatebox{90}{Fabrikobjekte}}
    & \begin{itemize}
      \item Fertigungseinrichtung
      \item Montageeinrichtungen
      \item Logistikeinrichtungen
      \item Qualitätseinrichtungen
      \item Informations- und Kommunikationseinrichtungen
      \item Ver- und Entsorgungseinrichtungen
      \item Übergeordnete Systeme
      \item Mobiliar
    \end{itemize} %
    & \begin{itemize}
      \item Unternehmensstrategie
      \item Logistikkonzept
      \item Prozessgestaltung
      \item Aufbauorganisations\-gestaltung
      \item Arbeitsorganisation
      \item Qualitätssicherungs\-konzept
    \end{itemize} %
    & \begin{itemize}
      \item Grundstück
      \item Baukonstruktion
      \item Technische Anlagen
      \item Außenanlagen
      \item Ausstattung
      \item Konzepte
    \end{itemize} \\%
    \hline
  \end{tabularx}%
  \label{tab:addlabel}%
\end{table}%

\end{document} 

enter image description here

Bernard
  • 271,350
  • Thank you very much Bernard!!! Unfortunately the code doesn't work completely and I don't know why. I tried different things but I cannot find a solution. I posted the picture how it looks like in my tex studios above. My column width is still not equal. I printed the table. Column (B) is 5 cm Column (O) is 5cm as well and column (R) is 5.5cm. The next thing I don't get is that the word "Betriebsmittel" and "Organisation" are not centered in their columns. The most awkward thing is the alignment of these items. You can see this in the new picture above. Sorry for all of these questions. ;) – Paul Jul 11 '17 at 11:39
  • @Paul: I think the difference in the column widths is due to the 3rd column head, which is a little too wide (whereas the list in this column has shorter items). For the bad centring of the first two column heads, I'll try to see what happens. – Bernard Jul 11 '17 at 12:05
  • @Paul: Problem solved. A simple \ makecellfor the column heads did the trick (previously, there were problems with colouring the head cells, that's why I used a more complicated solution). The third column is purposely not as wide as the firdst two, due to a less wide content. If yu really want to have all three columns to have the same width, replace the table preamble with{|c|*{3}{>{\RaggedRight}X|}}`. Note I changed some parameters for the list setup. – Bernard Jul 11 '17 at 12:26
  • Awesome!! It works perfectly. Thank you very much. I will try to get it done to learn more for my other tables I need to create ;) – Paul Jul 11 '17 at 12:27