Tabelle multirow und multicolumn Thema ist als GELÖST markiert

Tabellen und Grafiken erstellen und anordnen


basti-fantasti-48
Forum-Century
Forum-Century
Beiträge: 151
Registriert: So 4. Apr 2021, 14:27

Tabelle multirow und multicolumn

Beitrag 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}
Dateianhänge
images.png
images.png (8.54 KiB) 228 mal betrachtet

Benutzeravatar
Stefan Kottwitz
Admin
Admin
Beiträge: 2534
Registriert: Di 8. Jul 2008, 00:39
Kontaktdaten:

Re: Tabelle multirow und multicolumn

Beitrag 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

basti-fantasti-48
Forum-Century
Forum-Century
Beiträge: 151
Registriert: So 4. Apr 2021, 14:27

Re: Tabelle multirow und multicolumn

Beitrag von basti-fantasti-48 »

Danke aber wie funktioniert das einfügen dieser extra Zeile. Also auf dem Bild das C1 C2 C3

Benutzeravatar
Stefan Kottwitz
Admin
Admin
Beiträge: 2534
Registriert: Di 8. Jul 2008, 00:39
Kontaktdaten:

Re: Tabelle multirow und multicolumn

Beitrag 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

Antworten