It looks like there would be plenty enough space for the table to fit on the page before, where the subsubsection title of my document is. By decreasing the arraystretch to around 1.15, it will fit on the first page but then it really looks a little bit squeezed.
There has to be some sort of setting that forces this amount of whitespace around the table which makes it go on the next page. And I am looking for it.
- !h or b! is not an option, unfortunately, clear no-no from my tutor.
- I have tried all kinds of other positioning options after \begin{table} but none of them worked (except for h! or b!)
- \vspace and other manual methods to change the vertical position of the table directly are also a no-no. Don't ask me why, this is my second try at passing the class (and these were the "mistakes" I did in the first one) lmao.
- Oh, and other direct methods like \resizebox etc. are also unwelcome unfortunately.
This is the code, don't worry about the missing card symbols in the table (diamonds, hearts, ...). In my original file, I have another font that includes them but I left it out for this minimal example.
\documentclass[paper=a4, fontsize=12pt, parskip=half, captions=tableabove]{scrartcl}
\usepackage[top=3.5cm, bottom=3.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage[autostyle = true, german = quotes]{csquotes}
\usepackage{polyglossia}
\setdefaultlanguage{german}
\setotherlanguages{english}
\usepackage{ulem}
\usepackage[x11names]{xcolor}
\usepackage[plainheadsepline=true, plainfootsepline=true, headsepline=0.6pt, footsepline=0.6pt]{scrlayer-scrpage}
\pagestyle{scrheadings}
\clearpairofpagestyles
\ohead{\headmark}
\automark{section}
\cfoot{\pagemark}
\usepackage[font=singlespacing]{caption}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ragged2e}
\begin{document}
\subsubsection{random subsubsection}
%Math mode for percentages
\newcolumntype{O}{>{$\displaystyle\RaggedLeft}X<{$}}
\begin{table}[hb]
\caption{Rangfolge der Pokerhände aufsteigend}
\renewcommand{\arraystretch}{1.5}
\belowrulesep=0pt
\aboverulesep=0pt
\centering
\begin{tabularx}{\textwidth}{
>{\RaggedRight\arraybackslash}X|
>{\RaggedRight\arraybackslash}X
c
>{\RaggedRight\arraybackslash}X
O
}
\toprule
%erste Zeile
Name & Bedeutung & \multicolumn{1}{>{\RaggedRight\arraybackslash}X}{Beispiel} & Entscheidungskriterium & \multicolumn{1}{>{\RaggedRight\arraybackslash}X}{Wahrscheinlichkeit} \\
\cmidrule(r{10pt}){1-1} \cmidrule(l){2-5}
%restliche Zeilen
Höchste Karte & Keine der unteren Kombinationen & A♠ {\color{red}K♦} J♠ 7♣ 4♣ & Höhe der einzelnen Karten & 17,41 \% \\
Ein Paar (One Pair) & Zwei Karten gleichen Wertes & 10♠ {\color{red}10♥} J♦ 8♣ {\color{red}6♥} & Höhe des Paars + Beikarten & 43,83 \% \\
Zwei Paare (Two Pair) & Zwei Paare & {\color{red}J♦} J♠ 8♣ 8♠ A♠ & Höhe der Paare + Beikarten & 23,50 \% \\
Drilling \\(Three of a Kind) & Drei Karten gleichen Wertes & Q♣ {\color{red}Q♥} Q♠ {\color{red}A♥} 4♣ & Höhe des Drillings + Beikarten & 4,83 \% \\
Straße (Straight) & Fünf Karten in einer Reihe & {\color{red}7♥} 8♣ {\color{red}9♦ 10♥} J♠ & Höchste Karte & 4,62 \% \\
Flush & Fünf Karten in einer Farbe & 3♠ 5♠ 8♠ 9♠ K♠ & Höhe der einzelnen Karten & 3,03 \% \\
Full House & Ein Drilling und ein Paar & {\color{red}K♥} K♣ {\color{red}K♦} 9♠ {\color{red}9♦} & Höhe des Drillings und Höhe des Paars & 2,60 \% \\
Four of a Kind & Vier Karten gleichen Wertes & A♣ {\color{red}A♦ A♥} A♠ 4♠ & Höhe des Vierlings und der Beikarte & 0,17 \% \\
Straight Flush & Straße in einer Farbe & 8♣ 9♣ 10♣ J♣ Q♣ & Höchste Karte & 0,028 \% \\
Royal Flush & Straße in einer Farbe, Zehn bis Ass & {\color{red}10♦ J♦ Q♦ K♦ A♦} & Split Pot & 0,003 \% \\
\bottomrule
\end{tabularx}
\label{tab:Rangfolge der Pokerhände aufsteigend}
\end{table}
\end{document}
And here's the resulting table, currently placed on a page by itself. Observe the copious amounts of whitespace above and below the table.