2

I'm trying to make a simple table but the last column is overflowing without border even though the content is not in excess. I'm relatively new to latex so I'm not sure if I'm missing something.

I used the following code and I've also attached a picture of the output.

\begin{table*}[t]
\centering
\begin{tabular*}{\textwidth}{|l|l|p{1.2cm}|p{1cm}|l|l
|l|l|l|l|l|l}

\hline
\multicolumn{1}{|c|}{\textit{\textbf{Paper}}} 
& \multicolumn{1}{c|}{\textit{\textbf{Year}}} 
& \multicolumn{1}{c|}{\textit{\textbf{Methodology}}}
& \multicolumn{1}{c|}{\textit{\textbf{Modality}}}
& \multicolumn{1}{c|}{\textit{\textbf{Automatic}}}       
& \multicolumn{1}{c|}{\textit{\textbf{Supervision}}}  
& \multicolumn{1}{c|}{\textit{\textbf{Acc.}}} 
& \multicolumn{1}{c|}{\textit{\textbf{Precision}}} 
& \multicolumn{1}{c|}{\textit{\textbf{Sensitivity}}} 
& \multicolumn{1}{c|}{\textit{\textbf{Specificity}}} 
& \multicolumn{1}{c|}{\textit{\textbf{DS*}}} 
& \multicolumn{1}{c|}{\textit{\textbf{HS*}}} 
\tabularnewline \hline
[27] &  2022 &  BiTr-Unet & T1, T2, T1ce, FLAIR &   semi & supervised & 95\% &   - &    - & - & 0.96 &  9.1647 \\      
 \hline
[28] &  2021 &  LBTS-Net &  T1, T2, FLAIR & semi &  supervised &    98.11\% &    - &    - & - & 91\% &  -                       
\tabularnewline \hline
[29] &  2019 &  stacked sparse auto encoder &   T1, T2 &    automatic & unsupervised &  0.96 &  -  &    0.93 &  1 & 0.96 &  - 
\tabularnewline \hline
[30] &  2020 &  hybrid deep auto encoder &  T1, T2, T1ce, FLAIR & automatic &   unsupervised &  98.50\% & 0.96 &    0.96 &  0.9954  & - &   - 
\tabularnewline \hline
[31]    &2020&  MM-GAN& T1, T2, T1ce, FLAIR&    semi&   unsupervised&   -   &-  &-& -   &0.6903&    -       
\tabularnewline \hline
[32]&   2021&   DD-GAN  &T1 ,T2w ,T1c , FLAIR   &semi&  unsupervised    &-& 0.735   &0.613  &-  &0.619& -
\tabularnewline \hline
\end{tabular*}
\end{table*}

enter image description here

3
  • 1
    you end l|l} with no final | Commented Feb 20, 2023 at 15:55
  • 1
    {tabular*}{\textwidth} means that the table will go up to the full \textwidth. Usually is should be combined with something like this (in your case) {|l@{\extracolsep{\fill}}|l|p{1.2cm}|p{1cm}|l|l|l|l|l|l|l|l|} to tell it to extend not only the lines but the column separation space too. I think it should be enough in your case.
    – koleygr
    Commented Feb 20, 2023 at 16:17
  • 1
    @koleygr this resolved my problem, thanks a lot!
    – RyuFeng
    Commented Feb 20, 2023 at 16:29

1 Answer 1

2
  • Mostly of topic, since your problem is solved by comment, however, you may be interest to see another way to write your table.
  • With use of tblr of tabularray package your table code can be -- to my opinion of course -- more concise and clear:
\documentclass[twocolumn]{article}

\usepackage{tabularray}
\UseTblrLibrary{siunitx}


\begin{document}
%\begin{landscape}
    \begin{table*}[ht]
    \centering
    \small
\begin{tblr}{hlines, vlines,
             colsep = 4pt,
             colspec = {c l  X[1.3,l,m] 
                        *{3}{X[0.8,l, m, cmd=\hspace{0pt}]}
                             X[0.7,l, m, cmd=\hspace{0pt}] 
                        *{3}{X[0.6,l, m, cmd=\hspace{0pt}]}
                        *{2}{Q[l]} },
             row{1} = {font=\footnotesize\bfseries\itshape, c}
             }

Paper
    &   Year
        &   Methodology
            &   Modality
                &   Automatic
                    &   Supervision
                        &   Acc.
                            &   Preci\-sion
                                &   Sensi\-tivity
                                    &   Speci\-ficity
                                        &   DS*
                                            &   HS*     \\
{[27]} 
    &  2022
        &   BiTr-Unet
            &   T1, T2, T1ce, FLAIR
                &   semi
                    &   supervised
                        &   \qty{95}{\%}
                            & - & - & - &   0.96
                                            &   9.1647  \\
{[28]} 
    &  2021
        &   LBTS-Net
            &   T1, T2, FLAIR
                &   semi
                    &   supervised
                        &   \qty{98.11}{\%}
                            & - & - & - &   \qty{91}{\%}
                                            &  -            \\
{[29]} 
    &  2019
        &   stacked sparse auto encoder
            &   T1, T2
                &   automatic
                    &   unsupervised
                        &   0.96
                            & - & 0.93
                                & 1 & 0.96
                                        &  -            \\
{[30]}
    &  2020
        &   hybrid deep auto encoder
            &   T1, T2, T1ce, FLAIR
                &   automatic
                    &   unsupervised
                        &  \qty{98.50}{\%}
                            &   0.96
                                &   0.96
                                    &   0.9954
                                        & - & -         \\
{[31]}    
    &  2020
        &   MM-GAN& T1, T2, T1ce, FLAIR
            &   semi
                &   unsupervised
                    & - & - & - & - &   0.6903
                                        &  -            \\
{[32]}
    &  2021
        &   DD-GAN
            &   semi
                &   unsupervised
                    & - &   0.735
                            &   0.613
                                & - &   0.619
                                        &  -            \\
\end{tblr}
    \end{table*}
\end{document}

enter image description here

(red lines indicate page layout)

2
  • Hey, thanks for the answer, the columns definition looks a lot neater. Could you also explain what's happening in the colspec parameter? Thanks!
    – RyuFeng
    Commented Mar 14, 2023 at 12:27
  • @RyuFeng, the best explanation you can find in package documentation ;-)!. In colspec are used c and ` l` are column tape for centering and left align column contents, the same as at tabular table, in the ` X[1.3,l,m] ` koeficient 1,3 is ratio of X column width, c and m define horizontal and vertical align of cells contents. Command \cmd in other columns add zero space, by which is enabled hyphenation of the first word in cell's text. BTW, if answer solve your šproblem)s) you may consider to accept it (by clicking on the check mark at top left side of answer.
    – Zarko
    Commented Mar 14, 2023 at 13:35

You must log in to answer this question.

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