Suppose I had the following;
\begin{table}
\centering
\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{Table1} \\ \hline
A very long equation with k as input & Answer \\ \hline
1 & -19.0123 \\ \hline
2 & -16.4377 \\ \hline
3 & -13.3349 \\ \hline
4 & -11.7427 \\ \hline
5 & -10.1329 \\ \hline
6 & -9.0075 \\ \hline
7 & -6.0001 \\ \hline
\end{tabular}
\quad
\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{table2} \\ \hline
A very long equation with k as input & Answer \\ \hline
1 & -16.0123 \\ \hline
2 & -12.4377 \\ \hline
3 & -9.5532 \\ \hline
4 & -5.7427 \\ \hline
5 & -4.1329 \\ \hline
6 & -3.0075 \\ \hline
7 & -3.0001 \\ \hline
\end{tabular}
\quad
\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{table3} \\ \hline
A very long equation with k as input & Answer \\ \hline
1 & -5.0123 \\ \hline
2 & -2.4377 \\ \hline
3 & -3.3349 \\ \hline
4 & -1.7427 \\ \hline
5 & -1.1329 \\ \hline
6 & -1.0075 \\ \hline
7 & -1.0001 \\ \hline
\end{tabular}
\end{table}
Notice how the first columns only have small entries (At most they will have 8 figures), I was wondering what I could insert in this to make it so that that the title of column 1 (the long equation with k as input) would split into more than one row – whilst remaining centred.
Thanks – and apologies if this has already been answered,
Rob.
EDIT: The end idea is to ensure all tables are next to one another on the same row.
Best Answer
You can load
array
package and declare a new column typewith suitable value for 0.14 in
0.14\linewidth
. I have used\Centering
command fromragged2e
package inside the column. Also you will need[t]
fortabular
as inMWE
Following the tradition of the site, vertical lines are evil and a table that uses
booktabs
is neat, here is abooktabs
version:In the above tables, the number should have been in math mode (see the minus sign). To do that you can define another new column like
and use it as
Or.... use
siunitx
and itsS
column type: