1

I am creating two tables, But somehow, there is an empty line between these two tables.

\begin{table}[!htb]
\begin{center}
\captionof{table}{Properties of the magnetic Resolver}\label{tab:resvprop}
\begin{tabular}{|c|c|}
\hline
\textbf{Parameter} &      \textbf{Value}\\
\hline
Maximum amplitude of the excitation voltage        &       9.0V \\
Excitation frequency  &       10kHz \\   
Number of Pole pairs          &       4 \\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{table}[!htb] \begin{center} \captionof{table}{Properties of the Reference Encoder}\label{tab:Encprop} \begin{tabular}{|c|c|} \hline \textbf{Parameter} & \textbf{Value}\ \hline Pulses per Revolution/ Line count & 1024 \ Output signals & Sine, Cosine \
Output signal amplitude & 1.0V\ Accuracy & \pm 0.0176\textdegree \ Power supply & DC 5\pm 0.5 V\ \hline \end{tabular} \end{center} \end{table}

enter image description here

How Can I remove the empty space between the two tables?

karthik
  • 13
  • 3
    mostly it is from your two center environments, use \centering rather than the environment form in floats. – David Carlisle Mar 30 '21 at 13:18
  • 3
    Also, "table" tells TeX "put this where you think best". If you really want them next to each other, then look through https://tex.stackexchange.com/q/39017/107497 – Teepeemm Mar 30 '21 at 13:19
  • How about \vspace{-1em} between the two table environments? – Erwann Mar 30 '21 at 15:34

1 Answers1

0

The excess space is due to two factors

  1. center adds vertical space; use \centering instead;
  2. two consecutive floats are separated by the amount of \floatsep.

Here's how you can reduce it, still maintaining separate floats.

\documentclass{article}
\usepackage{siunitx}

\sisetup{separate-uncertainty}

\begin{document}

\begin{table}[!htb] \centering \caption{Properties of the magnetic Resolver}\label{tab:resvprop}

\begin{tabular}{|l|c|} \hline \multicolumn{1}{|c|}{\textbf{Parameter}} & \textbf{Value}\ \hline Maximum amplitude of the excitation voltage & \SI{9.0}{\volt} \ Excitation frequency & \SI{10}{\kilo\hertz} \ Number of Pole pairs & 4 \ \hline \end{tabular}

\end{table}

\begin{table}[!htb] \centering \caption{Properties of the Reference Encoder}\label{tab:Encprop}

\begin{tabular}{|l|c|} \hline \multicolumn{1}{|c|}{\textbf{Parameter}} & \textbf{Value}\ \hline Pulses per Revolution/Line count & 1024 \ Output signals & Sine, Cosine \
Output signal amplitude & \SI{1.0}{\volt} \ Accuracy & \SI{\pm 0.0176}{\degree} \ Power supply & DC \SI{5\pm 0.5}{\volt} \ \hline \end{tabular}

\end{table}

\end{document}

enter image description here

I used siunitx in order to get correct output for the measurements with their units. I also changed the alignment of the first columns to left.

You might prefer to use a single table environment, though. Here I also modify the table codes for better appearance. But you can take the idea and keep the caged tables, if you prefer.

\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}

\sisetup{separate-uncertainty}

\AtBeginEnvironment{table}{% \setlength{\belowcaptionskip}{\medskipamount} \setlength{\abovecaptionskip}{0pt}% }

\begin{document}

\begin{table}[!htb] \centering \caption{Properties of the magnetic Resolver}\label{tab:resvprop}

\begin{tabular}{@{}lc@{}} \toprule \multicolumn{1}{c}{Parameter} & Value \ \midrule Maximum amplitude of the excitation voltage & \SI{9.0}{\volt} \ Excitation frequency & \SI{10}{\kilo\hertz} \ Number of Pole pairs & 4 \ \bottomrule \end{tabular}

\bigskip

\caption{Properties of the Reference Encoder}\label{tab:Encprop}

\begin{tabular}{@{}lc@{}} \toprule \multicolumn{1}{c}{Parameter} & Value\ \midrule Pulses per Revolution/Line count & 1024 \ Output signals & Sine, Cosine \
Output signal amplitude & \SI{1.0}{\volt} \ Accuracy & \SI{\pm 0.0176}{\degree} \ Power supply & DC \SI{5\pm 0.5}{\volt} \ \bottomrule \end{tabular}

\end{table}

\end{document}

enter image description here

egreg
  • 1,121,712