I am trying to create the following table in latex:
I am having a problem fitting this table to an A4 page. My idea was to make the text wrap in the column headers but after having searched for over an hour online and having seen many solutions, I have not been able to make it work.
This is the latex code I have right now (N.B. I have cut all but the first two rows to reduce the amount of code for readablity.
\documentclass[a4paper, oneside]{discothesis}
\usepackage{tabulary}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{makecell}
\usepackage{ragged2e}
\begin{document}
\begin{table}[h!]
\setlength\tabcolsep{6pt}
\centering
\caption{Flushing efficiencies.}
\resizebox{\textwidth}{!}{\begin{tabular}{cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth}
cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth} cp{0.082\textwidth}}
\toprule
\multirow{2}{*}{\makecell{Loca- \\ tion}} & \multirow{2}{*}{\makecell{Reser- \\ voir}} &
\multirow{2}{*}{\makecell{Flushing \\ type}} & \multirow{2}{*}{\makecell{Flushing \\ Year(s)}} &
\multirow{2}{*}{\makecell{$V_{s,out}$ \\ $[m^3]$}} & \multirow{2}{*}{$V_{w,out} [m^3]$} &
\multirow{2}{*}{\makecell{Volumetric \\ mixture \\ concentra- \\ tion $\sigma$ \\ $[ml/l]$}} &
\multirow{2}{*}{Mean volumetric mixture concentration $\sigma_{,m} [ml/l]$} & \multirow{2}{*}{$V_{s,m,out} (FL) [m^3/a]$} & \multirow{2}{*}{$MAS (=V_{s,m,in}) [10^3 m^3/a]$} &
\multicolumn{2}{*}{Flushing efficiencies $\eta_{f} [\%]$} \\
& & & & & & & & & & $\eta_{\sigma}$ & $\eta_v$ \\
\multirow{5}{*}{CH} & \multirow{5}{*}{Ferden} & E & 2018 & 96,000 & 2,285,000 & 42.01 & \multirow{5}{*}{47.97} & \multirow{5}{*}{112,667} & \multirow{5}{*}{50} & 4.20 & \multirow{5}{*}{225.3} \\
& & E & 2016 & 120,000 & 4,030,000 & 29.78 & & & & 2.98 & \\
& & E & 2014 & 60,000 & 2,803,000 & 21.41 & & & & 2.14 & \\
& & E & 2013 & 160,000 & 3,796,000 & 42.15 & & & & 4.22 & \\
& & E & 2012 & 240,000 & 2,297,000 & 104.48 & & & & 10.45 & \\
\bottomrule
\end{tabular}}
\label{tab3:cp_values}
\end{table}
\end{document}
Right now, it gives me the following table (for some reason the \eta_sigma
and \eta_v
get pushed to the very right instead of being placed under the "flushing efficiencies"-cell):
Also, as you can see, the multirows with E's in them get pushed up into the column headers.
Thank you!
Edit 1: removed unnecessary packages
Edit 2: new table after having removed "c" from cp{0.082\textwidth}
discothesis
class file?article
class (and simplify the example by removing every package not used in the example (which is almost all the packages you list)