I have a question regarding tables in Latex. I tried to find a solution now for two hours, but couldn't fix all my problems in one code. So I found single solutions for everything, but couldn't bring them together.
I added some code and a picture to explain the table I want to have in the end. Unfortunately there are some points I don't like and hope someone can help me. I would like to have:
- No white colored spaces above and below the lines
- I would like to adjust the spacing between the lines generally
- The table shall have exactly the width of my text
- I want to adjust the width of all columns by my self specifying in percent
- I want in some cases have the first column colored differently
- I want the text in my head row to be white
- I need to use footnotes in the table. It doesn't matter if they are explained below the table or at the page bottom.
- I want to change the horizontal alignment of the cells with numbers in it to right align.
- I'm open to the package to use, so if needed feel free to propose another one :-)
Thank you very much for your help.
\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{colortbl}
\definecolor{Gray}{rgb}{0.80784, 0.86667, 0.90196} %dunkelblau
\definecolor{Lightgray}{rgb}{0.9176, 0.95, 0.95686} %hellblau
\definecolor{Akzent}{rgb}{0.6627, 0.63529, 0.55294} %akzentfarbe
\begin{document}
\lipsum[2]
\begin{table}
\begin{center}
\begin{tabularx}{\textwidth}{p{.15\linewidth} p{.1\linewidth} p{.2\linewidth} p{.2\linewidth} X}
\toprule
\rowcolor{Akzent}
Category & Size & Maximum Takeoff Weight (MTOW) (kg) & Normal Operating Altitude (ft) & Airspeed (m/s)\\
\midrule
\rowcolor{Gray}
Group 1 & Small & 0 - 20 & < 1,200 AGL & < 100\\
\rowcolor{Lightgray}
Group 2 & Medium & 21 - 55 & < 3500 & < 250\footnote{Explanation}\\
\bottomrule
\end{tabularx}
\caption{Table}
\end{center}
\end{table}
\end{document}
\cellcolor
, (6) see (1), (7) there is a\makesavenoteenv
(package\footnote
), (8) use a>{\raggedleft}p{.1\linewidth}
. These are just suggestions at first glance and may not work out perfectly, but see it as starting point.