2

I want to make a formal table in a report. I used the following code; however, I still need to remove the gaps between the cells contents and data to save space. Also, I want to center the cells vertically especially the first column

\documentclass[letterpaper,oneside,12pt]{book}
\usepackage[letterpaper, inner=2.5 cm, outer=2.5cm, bottom=2.5cm, dvips]{geometry} 
\usepackage{tabularx,booktabs,makecell,multirow}
\usepackage{enumitem}  % to control Itemization spacing

\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\renewcommand\theadfont{\bfseries}

\begin{document}
\begin{table}[htb]
  \centering
  \vspace{0.5cm}
  \caption{\small{Comparison between GPS and INS characteristics}}
  \vspace{0.5cm}
  \begin{tabularx}{\textwidth}{l L L}
      \toprule
         & \thead{GPS}           & \thead{INS}                   \\
      \midrule
      \multirow{4}{*}{\textbf{Advantages}}
         &  
       \begin{itemize}[noitemsep,topsep=0pt]
        \item Errors are bounded
        \item   Long term accuracy
        \item   Relatively low cost
       \end{itemize}
        &       
       \begin{itemize}[noitemsep,topsep=0pt]
         \item High data rate
         \item Self-contained and independent of jamming
         \item  Gives attitude information
        \item Short term accuracy
      \end{itemize}    \\
     \midrule      %\cmidrule{2-3}
     \multirow{4}{*}{\textbf{Disadvantages}}
    &   
    \begin{itemize}[noitemsep,topsep=0pt]
        \item Low data rate
        \item Susceptible to jamming and interference
        \item Fails if no sufficient coverage
        \item No attitude information for standard receivers
    \end{itemize}
        &  
    \begin{itemize}[noitemsep,topsep=0pt]
     \item  Errors grow with time
     \item  Higher cost for higher quality
     \end{itemize}   \\
  \bottomrule
\end{tabularx}
\label{tab:GPS_INS_comparison}
\end{table}
\end{document}   

This was my outputenter image description here

2 Answers 2

3

If you are looking for space reduction, you are choosing the wrong tabular environment (booktabs is generous in terms of space). So, I suggest the following (which you should only do when there is no other choice; these are not good practices):

  • get rid of booktabs
  • more importantly, reshape your table by transposing. The reason behind transposing is that the word Disadvantages is much longer than GPS.
  • set \arraystretch to 0
  • safely set \tabcolsep to a very small/negative value
  • choosing \small for the whole table will not hurt
  • take care of the spaces around the itemize environment

Finally, you can get this result:

enter image description here

Here is a MWE:

\documentclass[letterpaper,oneside,12pt]{book}
\usepackage[letterpaper, inner=2.5 cm, outer=2.5cm, bottom=2.5cm, dvips]{geometry}
\usepackage{tabularx,booktabs,makecell,multirow,array}
\usepackage{enumitem}  % to control Itemization spacing

\renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}m{#1}}
\newcolumntype{L}{>{\arraybackslash}X}
\renewcommand\theadfont{\bfseries}

\begin{document}
\begin{table}[htb]
 \small
 \caption{Comparison between GPS and INS characteristics}
 \renewcommand{\arraystretch}{0}
 \setlength{\tabcolsep}{-1pt}
 \centering
  \begin{tabularx}{\textwidth}{lLL}
      \hline
        & \thead{Advantages} & \thead{Disadvantages}    \\
      \hline
      \textbf{GPS}
        &  
       \begin{itemize}[noitemsep,topsep=0pt]
        \item Errors are bounded
        \item Long term accuracy
        \item Relatively low cost
       \end{itemize}
       &       
       \begin{itemize}[noitemsep,topsep=0pt]
        \item Low data rate
        \item Susceptible to jamming and interference
        \item Fails if no sufficient coverage
        \item No attitude info. for standard receivers 
      \end{itemize}\\[-.35cm]
     \hline      %\cmidrule{2-3}
     \textbf{INS}
    &   
    \begin{itemize}[noitemsep,topsep=0pt]
       \item High data rate
       \item Self-contained and jamming independent
       \item Gives attitude information
       \item Short term accuracy
    \end{itemize}
        &  
    \begin{itemize}[noitemsep,topsep=0pt]
     \item  Errors grow with time
     \item  Higher cost for higher quality
     \end{itemize}\\[-.35cm]
  \hline
\end{tabularx}
\label{tab:GPS_INS_comparison}
\end{table}
\end{document}
1
  • Thanks a lot @AboAmmar for your help and good suggestion May 31, 2015 at 17:24
3

Is that what you want?

\documentclass[letterpaper,oneside,12pt]{book}
\usepackage[letterpaper, inner=2.5 cm, outer=2.5cm, bottom=2.5cm, dvips]{geometry}
\usepackage{tabularx,booktabs,makecell,multirow, caption}
\usepackage{enumitem} % to control Itemization spacing
\renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}m{#1}}
\newcolumntype{L}{>{\arraybackslash}X}
\renewcommand\theadfont{\bfseries}

\begin{document}
\begin{table}[htb]
  \centering\setlist[itemize, 1]{noitemsep,topsep=0pt, wide=0pt, leftmargin =\dimexpr \labelwidth+ 2\labelsep\relax, after=\vspace*{\dimexpr-4\partopsep}}
  \caption{\small{Comparison between GPS and INS characteristics}}
  \begin{tabularx}{\textwidth}{lLL}
    \toprule
      & \thead{GPS} & \thead{INS} \\
    \midrule
    \textbf{Advantages}
    &
    \begin{itemize}
    \item Errors are bounded
    \item Long term accuracy
    \item Relatively low cost
    \end{itemize}
    &
    \begin{itemize}
    \item High data rate
    \item Self-contained and independent of jamming
    \item Gives attitude information
    \item Short term accuracy
    \end{itemize} \\
    \midrule %\cmidrule{2-3}
    \textbf{Disadvantages}
    &
    \begin{itemize}
    \item Low data rate
    \item Susceptible to jamming and interference
    \item Fails if no sufficient coverage
    \item No attitude information for standard receivers
    \end{itemize}
    &
    \begin{itemize}
    \item Errors grow with time
    \item Higher cost for higher quality
    \end{itemize} \\
    \bottomrule
  \end{tabularx}
  \label{tab:GPS_INS_comparison}
\end{table}
\end{document} 

enter image description here

0

You must log in to answer this question.

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