1

I used a code, I have a table which created by using tabularx, but the problem is that, I want to remove the word MADM into center of cell, and the head text into the center too, but I won't change the place of Text. as shown in picture :

enter image description here

I want to change it like that :

enter image description here

The code:

\documentclass[twocolumn]{svjour3}  
\usepackage{graphicx}
\usepackage{makecell, multirow, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}  % new
\usepackage{enumitem}                               % new
\newlist{tabitem}{itemize}{1}   % <-- defined new list
\setlist[tabitem]{nosep,        % <-- new list setup
                  leftmargin=*,
                  label=$\bullet$,
                  before=\begin{minipage}[t]{\linewidth}, 
                  after=\end{minipage}                   
                  }



    \begin{table} [htp]
    \setcellgapes{2pt}
    \centering
    \makegapedcells
    \setlength\tabcolsep{1pt}
\begin{tabularx}{\linewidth}
{|
L| 
p{0.18\textwidth} |
p{0.18\textwidth} | 
}  
  \hline
Text  & 
  Text 
            &   Text
            
              \\ 
    \hline
    
MADM &

\begin{tabitemize}
                \item   Text Text Text. 
                \item Text Text Text.
                \item Text Text Text.
                \item  Text Text-Text.
                \item Text Text.
 \end{tabitemize}
 & 
 
\begin{tabitemize}
                \item       Text Text Text. 
                \item Text Text Text the Text Text Text Text.
 \end{tabitemize}
 
    
             \\ 
    \hline
    
\end{tabularx}
    \end{table}
2
  • in preamble you define tabitem but in table you use tabitemize list ...
  • for horizontal centering of column headers you have more possibilities:
    • use \multicolumn{1}{|c|}{text}
    • use \hfil: \hfil Text & \hfil Text & \hfil Text \\
    • use \makecell as is done in MWE below
  • to move text MADM in vertical center in the first column you need to use \multirow instruction defined in the package with the same name
\documentclass[twocolumn]{svjour3}
\usepackage{graphicx}
\usepackage{makecell, multirow, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}  % new
\usepackage{enumitem}                               % new
\newlist{tabitem}{itemize}{1}   % <-- defined new list
\setlist[tabitem]{nosep,        % <-- new list setup
                  leftmargin=*,
                  label=$\bullet$,
                  before=\begin{minipage}[t]{\linewidth},
                  after=\end{minipage}
                  }

\begin{document}                 
    \begin{table} [htp]
    \setcellgapes{2pt}
    \centering
    \makegapedcells
    \setlength\tabcolsep{4pt}
\begin{tabularx}{\linewidth}{|L|L|L|}
    \hline
Text    &   Text    &   Text    \\
\multicell{Text}    
        &   \multicell{Text}   
            &   \multicell{Text}    \\
    \hline
\multirow{5}{=}{MADM}    
        &  \begin{tabitem}
        \item   Text Text Text.
        \item Text Text Text.
        \item Text Text Text.
        \item Text Text-Text.
        \item Text Text.
            \end{tabitem}
            &   \begin{tabitem}
            \item Text Text Text.
            \item Text Text Text the Text Text Text Text.
                \end{tabitem}   \\
    \hline
\end{tabularx}
    \end{table}
\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.