[Tex/LaTex] Center a fixed width text within a multicolumn

horizontal alignmentmulticolumntables

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.
enter image description here

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:

enter image description here

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:

\documentclass[twocolumn]{article}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\begin{document}
\begin{table}[htb]\centering
    \begin{tabular}{|P{5cm}|c|c|c|c|}
    \hline
    \multicolumn{1}{|c|}{}& \multicolumn{4}{c|}{\textbf{Concept}}\\ \hline
    %------------------------------------------------
\textbf{Critères d'évaluations}& Perfomance& Économie& Légèreté& Simplicité\\ \hline
    %------------------------------------------------
Précision des images thermiques [mK]& 50& 100& 65& 65 \\\hline
    %------------------------------------------------
Résolution spatiale [mm]& 19& 3.3& 19& 19\\\hline
    %------------------------------------------------
Stockage des données [To]& 4& 8& 4& 12\\\hline
    %------------------------------------------------
Résolution temporelle des images thermiques [fps]& 60& 64& 50& 50\\\hline
    %------------------------------------------------
Signal de sortie de la caméra thermique [bits]& 16& bites me & 14& 14\\\hline
    %------------------------------------------------
Interface de communication& 1& 1& 1& 1\\\hline
    %------------------------------------------------
Facilité du pilotage& 1& 1& 1& 1\\\hline
    %------------------------------------------------
Inspection autonome& 1& 0.75& 1& 1\\\hline
    %------------------------------------------------
Vitesse de vol [m/s]& 10& 20& 6& 10\\\hline
    %------------------------------------------------
Résistence au vent [km/h]& 36& 64& 97& 39.6\\\hline
    %------------------------------------------------
Autonomie de vol [min]& 75& 34& 50& 70\\\hline
    %------------------------------------------------
Poids du drone [kg]& 3.25& 2.27& 3.31& 2.915\\\hline
    %------------------------------------------------
Détection humaine à l'intérieur du périmètre radial [m] & 33.1& 33.1& 33.1& 33.1\\\hline
    %------------------------------------------------
Efficacité des mesures d'urgence& 1& 1& 1& 1\\\hline
    %------------------------------------------------
Sécurité constante des données& 1& 1& 1& 1\\\hline
    %------------------------------------------------
Respect constant des conditions de vol& 1& 1& 1& 0.5 \\\hline
    %------------------------------------------------
Coût total de production [\$]& 70 744& 13 920& 24 128& 67 130\\\hline
    \end{tabular}
\end{table}
\end{document}

As you can see, for centering of text in cels with p{...} column type I defined new column type P. For this you need to load package array.

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

\documentclass[twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{ragged2e}
\usepackage{array,booktabs,makecell}
\renewcommand\theadfont{\bfseries\sffamily}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}

\begin{document}
\begin{table}[htb]\centering
    \renewcommand{\arraystretch}{1.2}
\begin{tabular}{P{5cm}*{4}{S[table-format=3.3]}}%c|c|c|c|
                                        \toprule
    &   \multicolumn{4}{c}{\thead{Concept}}
                                    \\  \cmidrule{2-5}
\thead{Critères d'évaluations}
    &   {\thead{Perfomance}} 
        &   {\thead{Économie}} 
            &   {\thead{Légèreté}} 
                &   {\thead{Simplicité}}
                                    \\ \midrule
Précision des images thermiques [mK]
    & 50 & 100 & 65 & 65            \\
Résolution spatiale [mm]
    & 19 & 3.3 & 19 & 19            \\
Stockage des données [To]
    & 4 & 8 & 4 & 12                \\
Résolution temporelle des images thermiques [fps]
    & 60 & 64 & 50 & 50             \\
Signal de sortie de la caméra thermique [bits]
    & 16 & {bites me} & 14 & 14     \\
Interface de communication
    & 1 & 1 & 1 & 1                 \\
Facilité du pilotage
    & 1 & 1 & 1 & 1                 \\
Inspection autonome
    & 1 & 0.75 & 1 & 1              \\
Vitesse de vol [m/s]
    & 10 & 20 & 6 & 10              \\
Résistence au vent [km/h]
    & 36 & 64 & 97 & 39.6           \\
Autonomie de vol [min]
    & 75 & 34   & 50 & 70           \\
Poids du drone [kg]
    & 3.25 & 2.27 & 3.31 & 2.915    \\
Détection humaine à l'intérieur du périmètre radial [m] 
    & 33.1 & 33.1   & 33.1  & 33.1  \\
Efficacité des mesures d'urgence
    & 1 & 1 & 1 & 1                 \\
Sécurité constante des données
    & 1 & 1 & 1 & 1                 \\
Respect constant des conditions de vol
    & 1 & 1 & 1 & 0.5               \\
Coût total de production [\$]
    & \num{70 744} & \num{13 920} & \num{24 128} & \num{67 130}
                                    \\  \bottomrule
    \end{tabular}
\end{table}
\end{document}

enter image description here

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:

\documentclass{article}
%\usepackage{geometry}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
  \ExplSyntaxOn
\NewChildSelector{eachtwo}
  {
    \int_step_inline:nnnn {5}{2}{\l_tblr_childs_total_tl}
      { \clist_put_right:Nn \l_tblr_childs_clist {##1} }
  }
\ExplSyntaxOff

\begin{document}
    \begin{table}[htb]
    \centering
%    \small
\begin{tblr}{colsep   = 4pt,
             colspec  = {@{} X[l, m, font=\linespread{0.84}\selectfont,
                               cmd={\hangafter=1\hangindent=1em}]
                       *{4}{Q[c, si={table-format=3.3}]} 
                        @{}},
             row{1,2} = {font=\small\bfseries},
             row{3-Z} = {rowsep = 0.5pt},
             row{eachtwo} = {abovesep=1.5ex},
             }
    \toprule
\SetCell[r=2]{c}    Critères d'évaluations
    &   \SetCell[c=4]{c}   {{{Concept}}} 
        &   &   &                       \\
    \midrule
    &   {{{Perform.}}}
        &   {{{Économie}}}
            &   {{{Légèreté}}}
                &   {{{Simplicité}}}    \\
    \midrule
Précision des images thermiques [mK]
    & 50    & 100       & 65    & 65    \\
Résolution spatiale [mm]
    & 19    &   3.3     & 19    & 19    \\
Stockage des données [To]
    &  4    &   8       &  4    & 12    \\
Résolution temporelle des images thermiques [fps]
    & 60    &  64       & 50    & 50    \\
Signal de sortie de la caméra thermique [bits]
    & 16    & {{{bites me}}} 
                        & 14    & 14    \\
Interface de communication
    &  1    &   1       &  1    &  1    \\
Facilité du pilotage
    &  1    &   1       &  1    &  1    \\
Inspection autonome
    &  1    &   0.75    &  1    &  1    \\
Vitesse de vol [m/s]
    & 10    &  20       &  6    & 10    \\
Résistence au vent [km/h]
    & 36    &  64       & 97    & 39.6  \\
Autonomie de vol [min]
    & 75    &  34       & 50    & 70    \\
Poids du drone [kg]
    & 3.25  &   2.27    &  3.31 & 2.915 \\
Détection humaine à l'intérieur du périmètre radial [m]
    & 33.1  &  33.1     & 33.1  & 33.1  \\
Efficacité des mesures d'urgence
    &  1    &   1       &  1    & 1     \\
Sécurité constante des données
    &  1    & 1         &  1    & 1     \\
Respect constant des conditions de vol
    &  1    & 1         &  1    & 0.5   \\
Coût total de production [\$]
    & {{{\num{70 744}}}}      
            & {{{\num{13 920}}}} 
                        & {{{\num{24 128}}}} 
                                & {{{\num{67 130}}}}
                                        \\  
    \bottomrule
    \end{tblr}
\end{table}
\end{document}

With the new version of the package (2022B, already available on CTAN) the code will be even shorter and simpler.

enter image description here

(red lines show text area borders)