Align table control characters

This commit is contained in:
Florian 2025-11-17 16:19:58 +01:00
parent b4ab0f38d4
commit d01e0e7a2b
2 changed files with 33 additions and 35 deletions

View File

@ -106,9 +106,9 @@ Die gesamte Tabelle
\toprule \toprule
Sprache & Autor & Erscheinungsjahr & Dateiendung \\ Sprache & Autor & Erscheinungsjahr & Dateiendung \\
\midrule \midrule
C++ & Bjarne Stroustrup & 1985 & .cpp \\ C++ & Bjarne Stroustrup & 1985 & .cpp \\
Java & James Gosling & 1998 & .java \\ Java & James Gosling & 1998 & .java \\
Python & Guido van Rossum & 1991 & .py \\ Python & Guido van Rossum & 1991 & .py \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\end{table} \end{table}
@ -219,7 +219,7 @@ Eine Tabelle einfärben
\begin{tabular}{lll} \begin{tabular}{lll}
\toprule \toprule
Eine & \cellcolor{yellow}gelbe & Zelle \\ Eine & \cellcolor{yellow}gelbe & Zelle \\
Ein & \cellcolor{yellow!25}helleres & Gelb \\ Ein & \cellcolor{yellow!25}helleres & Gelb \\
\rowcolor[HTML]{FFDE21} \rowcolor[HTML]{FFDE21}
Eine & gelbe & Zeile \\ Eine & gelbe & Zeile \\
\bottomrule \bottomrule
@ -243,11 +243,11 @@ Zellen verbinden
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\begin{tabular}{lll} \begin{tabular}{lll}
\toprule \toprule
Tier & Futter & Größe \\ Tier & Futter & Größe \\
\midrule \midrule
Pferd & Heu & groß \\ Pferd & Heu & groß \\
Frosch & Fliegen & klein \\ Frosch & Fliegen & klein \\
Fooboar & \multicolumn{2}{c}{unbekannt} \\ Fooboar & \multicolumn{2}{c}{unbekannt} \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
``` ```
@ -271,10 +271,10 @@ Zeilenumbruch in einer Zelle
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\begin{tabular}{ll} \begin{tabular}{ll}
\toprule \toprule
Name & Beschreibung \\ Name & Beschreibung \\
\midrule \midrule
Katze & \makecell[l]{klein \\ schläft gerne} \\ Katze & \makecell[l]{klein \\ schläft gerne} \\
Hund & \makecell[l]{treu \\ braucht Spaziergänge} \\ Hund & \makecell[l]{treu \\ braucht Spaziergänge} \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
``` ```
@ -296,10 +296,10 @@ Die Spalte `p{4cm}` bricht den Text automatisch auf 4cm Breite um.
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\begin{tabular}{lp{4cm}} \begin{tabular}{lp{4cm}}
\toprule \toprule
Gegenstand & Beschreibung \\ Gegenstand & Beschreibung \\
\midrule \midrule
Stuhl & Vier Beine, eine Fläche \\ Stuhl & Vier Beine, eine Fläche \\
Tisch & Wie ein Stuhl, aber anders \\ Tisch & Wie ein Stuhl, aber anders \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
``` ```
@ -317,12 +317,11 @@ Weiterführendes Beispiel
\begin{table}[h] \begin{table}[h]
\begin{tabular}{llr} \begin{tabular}{llr}
\toprule \toprule
Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3} Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3} & Average & Worst \\
& Average & Worst \\
\midrule \midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\ Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\ Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\ AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\end{table} \end{table}

View File

@ -77,7 +77,7 @@ Table content
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\begin{tabular}{lll} \begin{tabular}{lll}
\toprule \toprule
Column 1 & Column 2 & Column 3 \\ Column 1 & Column 2 & Column 3 \\
\midrule \midrule
Content a & Content b & Content c \\ Content a & Content b & Content c \\
Content e & Content f & Content g \\ Content e & Content f & Content g \\
@ -106,9 +106,9 @@ The entire table
\toprule \toprule
Language & Author & Year & File extension \\ Language & Author & Year & File extension \\
\midrule \midrule
C++ & Bjarne Stroustrup & 1985 & .cpp \\ C++ & Bjarne Stroustrup & 1985 & .cpp \\
Java & James Gosling & 1998 & .java \\ Java & James Gosling & 1998 & .java \\
Python & Guido van Rossum & 1991 & .py \\ Python & Guido van Rossum & 1991 & .py \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\end{table} \end{table}
@ -222,7 +222,7 @@ Colouring a table
A & \cellcolor{yellow}yellow & cell \\ A & \cellcolor{yellow}yellow & cell \\
A & \cellcolor{yellow!25}lighter yellow & cell \\ A & \cellcolor{yellow!25}lighter yellow & cell \\
\rowcolor[HTML]{FFDE21} \rowcolor[HTML]{FFDE21}
A & yellow & row \\ A & yellow & row \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
``` ```
@ -243,11 +243,11 @@ Merge cells
```{.hljs .lang-tex} ```{.hljs .lang-tex}
\begin{tabular}{lll} \begin{tabular}{lll}
\toprule \toprule
Animal & Food & Size \\ Animal & Food & Size \\
\midrule \midrule
horse & hay & large \\ horse & hay & large \\
frog & flies & small \\ frog & flies & small \\
fooboar & \multicolumn{2}{c}{unknown} \\ fooboar & \multicolumn{2}{c}{unknown} \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
``` ```
@ -270,10 +270,10 @@ Line breaks in a cell
```{.hljs .lang-tex} ```{.hljs .lang-tex}
\begin{tabular}{ll} \begin{tabular}{ll}
\toprule \toprule
Name & Description \\ Name & Description \\
\midrule \midrule
Cat & \makecell[l]{small \\ likes to sleep} \\ Cat & \makecell[l]{small \\ likes to sleep} \\
Dog & \makecell[l]{loyal \\ needs walks} \\ Dog & \makecell[l]{loyal \\ needs walks} \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
``` ```
@ -295,9 +295,9 @@ The `p{4cm}` column automatically wraps text within 4cm.
```{.hljs .lang-tex} ```{.hljs .lang-tex}
\begin{tabular}{lp{4cm}} \begin{tabular}{lp{4cm}}
\toprule \toprule
Item & Description \\ Item & Description \\
\midrule \midrule
Chair & Four legs, one surface \\ Chair & Four legs, one surface \\
Table & Like a chair but different \\ Table & Like a chair but different \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
@ -317,12 +317,11 @@ An advanced example
\begin{table}[h] \begin{table}[h]
\begin{tabular}{llr} \begin{tabular}{llr}
\toprule \toprule
Structure & \multicolumn{2}{l}{Access time complexity} \\ \cmidrule(r){2-3} Structure & \multicolumn{2}{l}{Access time complexity} \\ \cmidrule(r){2-3} & Average & Worst \\
& Average & Worst \\
\midrule \midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\ Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binary tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(n)$ \\ Binary tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(n)$ \\
AVL tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\ AVL tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\end{table} \end{table}