3

In the below table I added \\ at the start to create a space between the variables, which worked, but now I have this gap- no border between the rows in the column that was initially there- as seen in screenshot- how do I get rid of these gaps again? Many thankss

enter image description here

code is:

% Uncomment the following line to allow the usage of graphics (.png, .jpg)
%\usepackage[pdftex]{graphicx}
% Comment the following line to NOT allow the usage of umlauts
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{amsmath}
% Start the document
\begin{document}

\begin{table}
        \centering % Centre the table on the slide
        \begin{tabular}{|c|c|c|c|}
            \toprule
            Name & Equation & Description & Variables\\
            \toprule
Reynolds & $Re=\frac{g}{g}$ & desc  & \shortstack{$\mu$- dynamic viscosity \\ v- velocity \\ L \\ $\rho $- density  }\\
\\ Ohnesorge & $Oh=\frac{f}{g}$ & $\rho$  & \shortstack{$\mu$ \\ $\sigma$- surface-tension coefficient \\ L \\ $\rho$ }\\ 
\\ Weber & We &  $\frac{ff}{ff}$ & \shortstack{$\nu$ \\ $\sigma$ \\ L \\ $\rho$ }\\
            


            
            \bottomrule
        \end{tabular}
            
        \end{table}

\end{document} 
  • 3
    Don't use vertical rules | with booktabs, it's designed againt these pipes. – AboAmmar Nov 29 '20 at 13:20
  • 1
    Replace \\ \\ with \\ & & & \\ – leandriis Nov 29 '20 at 13:27
  • thanks @leandriis that worked :)) – Sara Ismail-Sutton Nov 29 '20 at 13:47
3

I would write your tables like this:

enter image description here

\documentclass{article}
\usepackage{booktabs, makecell}
\usepackage{amsmath}

\begin{document}
    \begin{table}
    \centering % Centre the table on the slide
    \linespread{0.84}\selectfont
\begin{tabular}{lccl}
    \toprule
Name        & Equation & Description & Variables\\
    \midrule
Reynolds    & $Re=\frac{g}{g}$ & desc   & \makecell[l]{$\mu$: dynamic viscosity \\ 
                                                        $v$: velocity \\ 
                                                        L \\ 
                                                        $\rho$: density }\\
    \addlinespace[6pt]
Ohnesorge   & $Oh=\frac{f}{g}$ & $\rho$ & \makecell[l]{$\mu$: dynamic viscosity \\
                                                        $v$: velocity \\
                                                        L \\
                                                        $\rho$: density }\\
    \addlinespace[6pt]
Weber       & We      & $\frac{ff}{ff}$ & \makecell[l]{$\nu$ \\ 
                                                       $\sigma$ \\ 
                                                       L \\ 
                                                       $\rho$ }\\
    \bottomrule
\end{tabular}
        \end{table}
\end{document}
3

As in @Zarko's answer, I'd do away with all vertical lines -- trust me, they're not needed, and they won't be missed. I'd also left-align the cell contents, top-align the cell contents across rows, replace the second \toprule directive with \midrule, and replace the all-blank lines with the less profligate \addlinespace.

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc} % this is the default nowadays
\usepackage[T1]{fontenc} 
\usepackage{booktabs} % for \toprule, \midrule, \bottomrule, and \addlinespace macros
\usepackage{amsmath}  % for \smash[b] macro

% Start the document
\begin{document}
\begin{table}
\centering % Centre the table horizontally
    \begin{tabular}{@{} llll @{}} % suggestion: use 'l', not 'c', col. type
    \toprule
    Name & Equation & Description & Variables\\
    \midrule
    Reynolds & $\mathit{Re}=\smash[b]{\frac{g}{g}}$ & desc  
      & $\mu$ -- dynamic viscosity \\ 
    &&& $v$ -- velocity \\ 
    &&& $L$ \\
    &&& $\rho$ -- density  \\ 
    \addlinespace % <-- new
    Ohnesorge & $\mathit{Oh}=\smash{\frac{f}{g}}$ & $\rho$  
      & $\mu$ \\ 
    &&& $\sigma$ -- surface-tension coeff. \\ 
    &&& $L$ \\ 
    &&& $\rho$ \\  
    \addlinespace % <-- new
    Weber & $\mathit{We}$ &  $\smash{\frac{ff}{ff}}$ 
      & $\nu$ \\ 
    &&& $\sigma$ \\ 
    &&& $L$ \\ 
    &&& $\rho$ \\
    \bottomrule
    \end{tabular}
\end{table}
\end{document} 
2

If you actually want vertical rules compatible with the horizontal rules of booktabs (even if it is not at all in the spirit of booktabs), you can use {NiceTabular} of nicematrix.

\documentclass{article}
\usepackage{booktabs}
\usepackage{nicematrix}
\usepackage{makecell}
\usepackage{amsmath}
% Start the document
\begin{document}

\begin{table}
\centering % Centre the table on the slide
\begin{NiceTabular}{|c|c|c|c|}
\toprule
Name & Equation & Description & Variables\\
\toprule
Reynolds & $Re=\frac{g}{g}$ & desc  & \shortstack{$\mu$- dynamic viscosity \\ v- velocity \\ L \\ $\rho $- density  }\\
\\ Ohnesorge & $Oh=\frac{f}{g}$ & $\rho$  & \shortstack{$\mu$ \\ $\sigma$- surface-tension coefficient \\ L \\ $\rho$ }\\ 
\\ Weber & We &  $\frac{ff}{ff}$ & \shortstack{$\nu$ \\ $\sigma$ \\ L \\ $\rho$ }\\
\bottomrule
\end{NiceTabular}
\end{table}

\end{document} 

Output of the above code

I recommend the design in the spirit of booktabs as described in others answers.

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.