I am trying to make a table with the multicolumn
package. I know that you can either align a cell with:
\multicolumn{[# of columns]}{l, c or r}{[text]}
Or you can set the width of said multicolumn with:
\multicolumn{[# of columns]}{p{whatever size you wish}{[text]}
My question is: Is it possible to both set the size of a column AND align it horizontally?
Here's the table I'm working on:
As you can see the cell "Detection humaine à l'intérieur du perimetre radial" (It's french) had his size fixed to 4cm (randomly chosen) and is no longer centered.
And here's the code that generates it:
Thank you for your help.
\section{Synth\`ese} \label{s:synthese}
\begin{table}[!ht]
\begin{center}
\begin{tabular}{ccccc}
\hline
\multicolumn{1}{|c|}{} & \multicolumn{4}{c|}{\textbf{Concept}} \\ \hline
%------------------------------------------------
\multicolumn{1}{|c|}{\textbf{Critères d'évaluations}} & \multicolumn{1}{c|}{Perfomance} & \multicolumn{1}{c|}{Économie} & \multicolumn{1}{c|}{Légèreté} & \multicolumn{1}{c|}{Simplicité} \\ \hline
%------------------------------------------------
\multicolumn{1}{|c|}{Précision des images thermiques [mK]} & \multicolumn{1}{c|}{50} & \multicolumn{1}{c|}{100} & \multicolumn{1}{c|}{65} & \multicolumn{1}{c|}{65} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Résolution spatiale [mm]} & \multicolumn{1}{c|}{19} & \multicolumn{1}{c|}{3.3} & \multicolumn{1}{c|}{19} & \multicolumn{1}{c|}{19} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Stockage des données [To]} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{8} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{12} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Résolution temporelle des images thermiques [fps]} & \multicolumn{1}{c|}{60} & \multicolumn{1}{c|}{64} & \multicolumn{1}{c|}{50} & \multicolumn{1}{c|}{50} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Signal de sortie de la caméra thermique [bits]} & \multicolumn{1}{c|}{16} & \multicolumn{1}{c|}{bites me} & \multicolumn{1}{c|}{14} & \multicolumn{1}{c|}{14} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Interface de communication} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Facilité du pilotage} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Inspection autonome} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0.75} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Vitesse de vol [m/s]} & \multicolumn{1}{c|}{10} & \multicolumn{1}{c|}{20} & \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{10} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Résistence au vent [km/h]} & \multicolumn{1}{c|}{36} & \multicolumn{1}{c|}{64} & \multicolumn{1}{c|}{97} & \multicolumn{1}{c|}{39.6} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Autonomie de vol [min]} & \multicolumn{1}{c|}{75} & \multicolumn{1}{c|}{34} & \multicolumn{1}{c|}{50} & \multicolumn{1}{c|}{70} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Poids du drone [kg]} & \multicolumn{1}{c|}{3.25} & \multicolumn{1}{c|}{2.27} & \multicolumn{1}{c|}{3.31} & \multicolumn{1}{c|}{2.915} \\\hline
%------------------------------------------------
\multicolumn{1}{|p{4cm}|}{Détection humaine à l'intérieur du périmètre radial [m]} & \multicolumn{1}{c|}{33.1} & \multicolumn{1}{c|}{33.1} & \multicolumn{1}{c|}{33.1} & \multicolumn{1}{c|}{33.1} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Efficacité des mesures d'urgence} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Sécurité constante des données} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Respect constant des conditions de vol} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{0.5} \\\hline
%------------------------------------------------
\multicolumn{1}{|c|}{Coût total de production [\$]} & \multicolumn{1}{c|}{70 744} & \multicolumn{1}{c|}{13 920} & \multicolumn{1}{c|}{24 128} & \multicolumn{1}{c|}{67 130} \\\hline
\end{tabular}
\end{center}
\end{table}
Best Answer
Probably you looking for something like this:
Edit (after six year!): For design of table you first need to read some basic literature about LaTeX, for example https://en.wikibooks.org/wiki/LaTeX/Tables (section 2.8).
Most of
\multicolumns
in table are clutter. It seems that you for writing of table use some table generator, which are inclined to generation of them even when are not needed. Consequently, as a result, it’s like awful ...For above showed picture I thoroughly cleaned your code. It is much shorter and clearer now:
As you can see, for centering of text in cels with
p{...}
column type I defined new column typeP
. For this you need to load packagearray
.How to designa better lookin tables this on-line presentation. On this sie (TeX:SE) can bi find many examples of beautifully deigned tables.
Maybe in the first step you remove vertical lines and for number aligning use
siunitx
package.Edit: Meanwhile I play with your table to see how to improve looking of your table, Heiko bit me with nice example. Anyway, since my suggestion is slightly different, see, if you can use/learn for future table designs
Edit 2: (use of tabularray): Meanwhile has been developed new, very powerful package
tabularray
. Using it at writing of tables is even more consistent. Resulting table is characterized by concise code:With the new version of the package (2022B, already available on CTAN) the code will be even shorter and simpler.
(red lines show text area borders)