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

View File

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