0

I prepared a small MWE that replicates the problem I am having. How do I properly center the header of a table for an IEEE publication?

Below the incorrect behavior:

enter image description here

Below the correct behavior I am looking for:

enter image description here

Below what I have done so far:

\documentclass{ieeetran}
\usepackage{ragged2e}  
\usepackage{booktabs, makecell, 
            tabularx}  % added
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt}%
                     \hsize=#1\hsize}X} % new
\usepackage{siunitx} % consider is v3

\begin{document} 

% Paragraphs... 

\begin{table*}
\caption{Ranking of research methodologies for QUERY-1}
\setlength{\tabcolsep}{4pt}
\setcellgapes{3pt}
\makegapedcells
\begin{tabularx}{\linewidth}{@{} >{\itshape}L{0.9}cc cL{1.1}c}
% \begin{tabularx}{\textwidth}{@{}l*{10}{C}c@{}}
    \toprule
\multicolumn{2}{@{} l}{Breakdown of research methodologies} \\
    \midrule
\normalfont{Criterion 1} 
    & Criterion 2 & Criterion 3 & Classification & Papers using the research method \\
    \midrule
Analytical 
    & Qualitative & Conceptual & Literature review & 21 \\
    
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
     
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
    
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
    
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
   
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
    
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\

Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
  
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\

Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
    \bottomrule
\end{tabularx}
\end{table*}

In order to solve the problem I tried several solutions I found int this source, this other source. In order to be even more precise this is what I tried:

\begin{table*}
  \centering
  \begin{tabularx}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}

But that didn't work as the post described. But also I tried another approach, which is a more general approach see below:

\begin{table}
 \centering
 \begin{tabularx}{|c|c|c|c|c|}

None of the solution gave me the expected behavior. Please point to the right direction to find a solution to this issue.

EDITS

As advised by a user, in order to properly align the header in the middle the following modification should be introduced at the beginning:

\begin{table*}
\caption{Ranking of research methodologies for QUERY-1}
\setlength{\tabcolsep}{4pt}
\setcellgapes{3pt}
\makegapedcells
\begin{tabularx}{\linewidth}{@{}X !{\qquad}Xc!{\qquad}Xc!{\qquad}Xc}

   % Table stuff...

   \bottomrule
\end{tabularx}
\end{table*}

However, the extra space between the column still persists and as you see below this is still the incorrect behavior as I am looking for a more condensed table as I show in the question.

enter image description here

7
  • 2
    If IEEE publication use ieeetran document class, neither examples are correct. Don't reformat caption style, which is determined by their document class.
    – Zarko
    Jul 1, 2021 at 22:05
  • Thanks for reading the question. Based on your comment I switched the beginning \documentclass{ieeetran} with \documentclass[conference]{IEEEtran} but that also didn't solve the problem. Is that what you were referring to?
    – Emanuele
    Jul 1, 2021 at 22:17
  • 2
    Even if you are able to modify the caption, IEEE will make you change it back again. Jul 2, 2021 at 3:25
  • I see, so what can I do to solve this issue? I just think that the misalignment is very strange especially after I seem to have everything almost correct.
    – Emanuele
    Jul 2, 2021 at 12:19
  • Technically speaking I can't see the mistake I am making. Therefore I don't understand this strange behavior. Any suggestions?
    – Emanuele
    Jul 2, 2021 at 12:29

2 Answers 2

1

The table uses the entire width of the page, so the extra space has to go somewhere.

Having inter columns spaces of equal width gives a more pleasant distribution.

x

\documentclass{ieeetran}

\usepackage{ragged2e}  
\usepackage{booktabs, makecell,     tabularx}  % added
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt} \hsize=#1\hsize}X} % new
\usepackage{siunitx} % consider is v3

\newcolumntype{Y}{>{\centering\arraybackslash}X}% added <<<<<<<<<<
\begin{document}
    
\begin{table*}
    \caption{Ranking of research methodologies for QUERY-1}
    \setlength{\tabcolsep}{4pt}
    \setcellgapes{3pt}
    \makegapedcells     
        \begin{tabularx}{\linewidth}{@{} XXXX Y}% changed <<<<
        \toprule
        \multicolumn{2}{@{} l}{Breakdown of research methodologies} \\
        \midrule
        \normalfont{Criterion 1} 
        & Criterion 2 & Criterion 3 & Classification & Nro  papers \\
        \midrule
        Analytical 
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Analytical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Analytical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Analytical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Analytical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Empirical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Empirical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Empirical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Empirical
        & Qualitative & Conceptual & Literature review & 21 \\
        
        Empirical
        & Qualitative & Conceptual & Literature review & 21 \\
        \bottomrule
    \end{tabularx}
\end{table*}    
    
\end{document}

Using instead \begin{tabularx}{\linewidth}{@{} XXXX c} (and the longer header of the last column} you get a table similar to the one shown in the question.

y

1

This version uses tabular*. It equalizes the gaps between the columns.

\documentclass{ieeetran}
\usepackage{booktabs}
\usepackage{siunitx} % consider is v3

\usepackage{lipsum}% MWE only

\begin{document} 
% Paragraphs... 

\begin{table*}
\caption{Ranking of research methodologies for QUERY-1}

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} ccccc @{}}
%\begin{tabularx}{\textwidth}{@{}l*{10}{C}c@{}}
    \toprule
\multicolumn{2}{@{}l}{Breakdown of research methodologies} \\
    \midrule
{\normalfont Criterion 1} 
    & Criterion 2 & Criterion 3 & Classification & Papers using the research method \\
    \midrule
Analytical 
    & Qualitative & Conceptual & Literature review & 21 \\
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
Analytical
    & Qualitative & Conceptual & Literature review & 21 \\
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
Empirical
    & Qualitative & Conceptual & Literature review & 21 \\
    \bottomrule
\end{tabular*}
\end{table*}

\lipsum[1-16]

\end{document}

demo

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .