Seite 1 von 1

Tabelle multirow und multicolumn

Verfasst: Fr 5. Apr 2024, 13:25
von basti-fantasti-48
Hallo ich möchte eine Tabelle wie im bild. Multirow habe ich hinbekommen aber mit der column nicht. Kann mir da jemand meinen code ergänzen?
\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{multirow}
\begin{document}
\begin{tabular}{c c c}
	\toprule
	Controllabilty & Exposure & Severity \\
	\midrule
	\multirow{3}{*}{C1} & E1 & QM \\
	
	&  E2 & QM \\
	&  E3 &QM \\
	& E4 & QM \\
	\midrule
		\multirow{3}{*}{C1} & E1 & QM \\
	&  E2 & QM \\
	&  E3 &QM \\
	& E4 & QM \\
		\midrule\multirow{3}{*}{C1} & E1 & QM \\
	&  E2 & QM \\
	&  E3 &QM \\
	& E4 & QM \\
	\bottomrule

	\end{tabular}
\end{document}

Re: Tabelle multirow und multicolumn

Verfasst: Fr 5. Apr 2024, 23:31
von Stefan Kottwitz
So hast Du beispielsweise Exposure über zwei Spalten:
\multicolumn{2}{c}{Exposure}
Komplett:
\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{multirow}
\begin{document}
\begin{tabular}{c c c}
	\toprule
	Controllabilty & \multicolumn{2}{c}{Exposure} \\
	\midrule
	\multirow{3}{*}{C1} & E1 & QM \\
	
	&  E2 & QM \\
	&  E3 &QM \\
	& E4 & QM \\
	\midrule
		\multirow{3}{*}{C1} & E1 & QM \\
	&  E2 & QM \\
	&  E3 &QM \\
	& E4 & QM \\
		\midrule\multirow{3}{*}{C1} & E1 & QM \\
	&  E2 & QM \\
	&  E3 &QM \\
	& E4 & QM \\
	\bottomrule

	\end{tabular}
\end{document}
Hier sind übrigens ein paar Beispiele zum Überspannen von Zeilen und Spalten: LaTeX Beginner's Guide, Chapter 6, Creating Tables.

Stefan

Re: Tabelle multirow und multicolumn

Verfasst: Mo 8. Apr 2024, 09:13
von basti-fantasti-48
Danke aber wie funktioniert das einfügen dieser extra Zeile. Also auf dem Bild das C1 C2 C3

Re: Tabelle multirow und multicolumn

Verfasst: Mo 8. Apr 2024, 10:20
von Stefan Kottwitz
C1, C2 und C3 sind ganz normale einzelne Zellen. Du brauchst natürlich in der Tabellen-Definition 6 Spalten dann, also \begin{tabular}{cccccc}.

Stefan