1

I am having trouble vertically aligning the first column. Could you suggest any other way to make this table look attractive? I would appreciate it.

\documentclass[journal]{IEEEtran}
\usepackage{ifpdf}
\usepackage{cite}
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\else
\fi
\usepackage{amsmath}
\usepackage[siunitx]{circuitikz}
\usepackage{tabularx,booktabs}
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{algorithmic}
\usepackage{array}
\ifCLASSOPTIONcompsoc
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\else
\usepackage[caption=false,font=footnotesize]{subfig}
\usepackage{fixltx2e}
\usepackage{xcolor}
\usepackage{stfloats}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{blindtext}
\begin{document}
    \begin{table*}[t]
        \renewcommand{\arraystretch}{1.25}
        \centering % default value: 6pt
        \caption{Comparison of Algorithm Results}\label{tab_com}

        \begin{tabularx}{0.8\linewidth}{ 
                @{\hspace{0em}} >{\hsize=0.3\hsize}L    
                @{\hspace{-7em}} >{\hsize=0.3\hsize}L
                @{\hspace{-5em}} >{\hsize=0.3\hsize}L
                @{\hspace{1em}} >{\hsize=0.3\hsize}L
                @{\hspace{0em}} >{\hsize=0.5\hsize}L }
            \toprule
            %% disable left-hand padding in first cell via "@{}" particle
            \centering\arraybackslash\hspace{-2em}\textbf{} & \textbf{Capacitor} & \textbf{Trimming} & \textbf{Servo}\\
            \midrule
            
            \vspace{0em}\hspace{1em} \textbf{Strength} & \parbox[t]{0.2\textwidth}{%
                \begin{itemize}[leftmargin=1em,itemsep=0.5pt,parsep=0pt]\raggedright%
                    \item Simplicity
                    \item Cost-effectiveness
                    
            \end{itemize}} &\parbox[t]{0.25\textwidth}{%
                \begin{itemize}[leftmargin=1em,itemsep=0.5pt,parsep=0pt]\raggedright%
                    
                    \item Ease of implementation
                    \item Time-efficient
                    
            \end{itemize}}&\parbox[t]{0.25\textwidth}{%
                \begin{itemize}[leftmargin=1em,itemsep=0.5pt,parsep=0pt]\raggedright%
                    \item An offset of low DC is possible
                    \item The DC offset is actively removed
                    \item Adjustable low-frequency roll-off
            \end{itemize}}  \\
            
            \vspace{0em}\hspace{1em} \textbf{Weakness}  &  \parbox[t]{0.2\textwidth}{%
                \begin{itemize}[leftmargin=1em,itemsep=0.5pt,parsep=0pt]\raggedright%
                    \item Time-consuming                    \item big and bulky
            \end{itemize}} & \parbox[t]{0.25\textwidth}{%
                \begin{itemize}[leftmargin=1em,itemsep=0.5pt,parsep=0pt]\raggedright%
                    \item During operation Adjustments
                    \item Accumulated DCs Offsett
            \end{itemize}} & \parbox[t]{0.25\textwidth}{%
                \begin{itemize}[leftmargin=1em,itemsep=0.5pt,parsep=0pt]\raggedright%
                    \item A supply rail system is needed
                    \item Power requirements
                    \item Must be carefully designed
                    
            \end{itemize}}\\
            
            \bottomrule
        \end{tabularx}
    \end{table*}

\end{document}

1 Answer 1

2

Like this?

enter image description here

\documentclass[journal]{IEEEtran}
\usepackage{ragged2e}
\usepackage{array, booktabs,tabularx}
\newcolumntype{L}[1]{>{\RaggedRight%
                       \hsize=#1\hsize%                 % <---
                       \linewidth=\hsize}X}             % <---
\usepackage{xcolor}
\usepackage{enumitem}

\usepackage{lipsum}
\begin{document}
\lipsum[66]
    \begin{table*}[ht]
        \renewcommand{\arraystretch}{1.25}
        \centering 
        \caption{Comparison of Algorithm Results}
        \label{tab_com}

        \setlist[itemize]{nosep,
                          leftmargin = *,
                          label      = $\bullet$ ,
                          after=\end{minipage},                  % <---
                          before=\begin{minipage}[t]{\linewidth} % <---
                             }
        \begin{tabularx}{0.8\linewidth}{>{\bfseries}l 
                                        L{0.8}
                                        L{1} 
                                        L{1.2}
                                        }
            \toprule
            & \textbf{Capacitor} & \textbf{Trimming} & \textbf{Servo}\\
            \midrule
        Strength    &   \begin{itemize}
                    \item Simplicity
                    \item Cost-effectiveness
                        \end{itemize}
                        &   \begin{itemize}
                        \item Ease of implementation
                        \item Time-efficient
                            \end{itemize}
                            &   \begin{itemize}
                            \item An offset of low DC is possible
                            \item The DC offset is actively removed
                            \item Adjustable low-frequency roll-off
                                \end{itemize}       \\
        Weakness    &   \begin{itemize}
                    \item Time-consuming                    
                    \item big and bulky
                        \end{itemize}
                        &  \begin{itemize}
                        \item During operation Adjustments
                        \item Accumulated DCs Offsett
                            \end{itemize}
                            &  \begin{itemize}
                            \item A supply rail system is needed
                            \item Power requirements
                            \item Must be carefully designed
                                \end{itemize}       \\

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

Edit:

  • Your table code is unnecessary complicated. Since you have all columns equal width, you can omit all settings of their widths.
  • Use of \parbox inside columns is not consistent and not needed
  • If you like to have different columns width where contents are lists (itemize), you need to redefine their width as follows: {\hsize=#1\hsize\linewidth=\hsize} or for more convenient writing of column specifications as is done in above MWE
  • remove from your document preamble all of duplicates

Addendum Your table can be fit in one column. For this I suggest

  • reduce size of \tabcolsep (from default 6pt to for example 4pt)
  • reduce font size to \small
  • remove first and last space in table by inserting @{} at begin and end of column specification
  • first column replace with row
\documentclass[journal]{IEEEtran}
\usepackage{ragged2e}
\usepackage{array, booktabs,tabularx}
\newcolumntype{L}[1]{>{\RaggedRight%
                       \hsize=#1\hsize%                 % <---
                       \linewidth=\hsize}X}             % <---
\usepackage{xcolor}
\usepackage{enumitem}

\usepackage{lipsum}
\begin{document}
\lipsum[66]
    \begin{table}[ht]
        \small
        \renewcommand{\arraystretch}{1.1}
        \centering 
        \caption{Comparison of Algorithm Results}
        \label{tab_com}

        \setlist[itemize]{nosep,
                          leftmargin = *,
                          label      = $\bullet$ ,
                          after=\end{minipage},                  % <---
                          before=\begin{minipage}[t]{\linewidth} % <---
                             }
        \setlength\tabcolsep{3pt}
        \begin{tabularx}{\linewidth}{@{} L{0.9}
                                            L{1}
                                            L{1.1}
                                        @{} }
            \toprule
        \textbf{Capacitor} & \textbf{Trimming} & \textbf{Servo}\\
            \midrule
        \multicolumn{3}{c}{\textbf{Strength:}}       \\
            \begin{itemize}
        \item Simplicity
        \item Cost-effectiveness
            \end{itemize}
            &   \begin{itemize}
            \item Ease of implementation
            \item Time-efficient
                \end{itemize}
                &   \begin{itemize}
                \item An offset of low DC is possible
                \item The DC offset is actively removed
                \item Adjustable low-frequency roll-off
                    \end{itemize}                   \\
            \midrule
        \multicolumn{3}{c}{\textbf{Weakness:}}      \\
            \begin{itemize}
        \item Time-consuming
        \item big and bulky
            \end{itemize}
            &  \begin{itemize}
            \item During operation Adjustments
            \item Accumulated DCs Offsett
                \end{itemize}
                &  \begin{itemize}
                \item A supply rail system is needed
                \item Power requirements
                \item Must be carefully designed
                    \end{itemize}       \\

            \bottomrule
        \end{tabularx}
    \end{table}
\end{document}

enter image description here

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.