Good day all!
I store tables on CSV files and use pgfplotstable package to call the files. This works fine but I have a challenge. I need to bring the units in bracket (i.e (MeV) and (mb/MeV/sr) e.t.c.) to the next line so that I'll have two lines dedicated to the head row and the width of the coulumns does not get too large. I need someone to help me out! Please find below an excerpt of my latex code. Thanks in advance…
\begin{table}
\caption{\label{tab:knockho3}As in table~\ref{tab:knockho1} but for complementary angles of \mbox{$60^\circ - 120^\circ$}.}
\centering
\resizebox{\columnwidth}{!}{%
\pgfplotstabletypeset[col sep=comma,
columns/Energy (MeV)/.style={string type},
columns/Experiment (mb/MeV/sr)/.style={string type},
columns/Error (mb/MeV/sr)/.style={string type},
columns/Simulation (mb/MeV/sr)/.style={string type},
every head row/.style={
before row=\toprule,
after row=\midrule},
every last row/.style={after row=\bottomrule}
]{Tables/knockho3.csv}%
}
\end{table}
Best Answer
Answer the Unanswered....
You can either enforce a line break in the header cells via various boxes or just use another row dedicated for the units. A quick example with made-up data and units(hopefully I got the right ones).