3

I would like to have a vertical line before the last column, despite I used this symbol "vertical line" it does not appear, why?

  \begin{document}
\begin{table}
  \centering
%  \setlength{\tabcolsep}{.14cm} % Abstand zwischen den Spalten einer Tabelle
  \caption{babalaba.}
   \begin{tabular}{ccclc}
\toprule
 {L1}&{Linkers}&{L3}&{Dyes} \\
   \hline 
    RNA1 & \multirow{2}{*}[-0.72ex]{cL}& {D dye}\\
   \\[-1em]
 blabla & & {D dye}\\
%\bottomrule
\hline 
\end{tabular}
\label{table1}
\end{table}
\end{document}

https://i.sstatic.net/CUukj.png

Indeed I used the letter l instead of |

\begin{document}
\begin{table}
  \centering
%\setlength{\tabcolsep}{.14cm} % Abstand zwischen den Spalten einer 
Tabelle
  \caption{babalaba.}
\begin{tabular}{ccc|c}
\toprule
{L1}&{Linkers}&{L3}&{Dyes} \\
\hline 
 RNA1 & \multirow{2}{*}[-0.72ex]{cL}&{D dye}\\
 \\[-1em]
 blabla & & {D dye}\\
%\bottomrule
\hline 
\end{tabular}
\label{table1}
\end{table}
 \end{document}

However now I have a discontinuous vertical line:enter image description here

5
  • Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it).
    – dexteritas
    Commented Aug 3, 2017 at 9:10
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – dexteritas
    Commented Aug 3, 2017 at 9:12
  • 2
    It seems you wrote l (L-letter) instead of | in the tabular definition.
    – dexteritas
    Commented Aug 3, 2017 at 9:13
  • You should only add the required packages to make a minimal working example (MWE).
    – dexteritas
    Commented Aug 3, 2017 at 9:18
  • booktabs would say you don't need the vertical line and should remove it. I don't understand your table well enough to see how the information relates in order to do that.
    – Teepeemm
    Commented May 17 at 12:53

3 Answers 3

2

like this:

enter image description here

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{array, booktabs, makecell, multirow}
\setcellgapes{5pt}
\setlength\belowrulesep{0pt}
\setlength\aboverulesep{0pt}

\begin{document}
\begin{table}[ht]
    \makegapedcells
  \centering
\caption{babalaba.}
\begin{tabular}{ccc|c}
    \toprule
{L1} & {Linkers} & {L3} & {Dyes}            \\
    \midrule
 RNA1 & \multirow{2}{*}[-3pt]{cL}&{D dye}   \\
 blabla & & {D dye}                         \\
    \bottomrule
\end{tabular}
\label{table1}
\end{table}
\end{document}

use of booktabs' rules and vertical lines gives quite ugly result: discontinuous vertical lines. to remove them, you can set vertical distances above(below rues and this distance replaces with facility of some other packages, for example by makecell as is done in above mwe.

1

If you actually want to draw vertical rules in conjunction with the rules of booktabs (this is not at all in the spirit of booktabs), you should try {NiceTabular} of nicematrix. In this environment, the vertical rules are never broken (by design).

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{nicematrix,booktabs}

\begin{document}

\begin{table}[ht]
\centering
\caption{babalaba.}
\begin{NiceTabular}{ccc|c}
\toprule
L1 & Linkers & L3 & Dyes \\
\midrule
 RNA1 & \Block{2-1}{cL} & D dye \\
 blabla & & D dye \\
\bottomrule
\end{NiceTabular}
\label{table1}
\end{table}

\end{document}

Output of the above code

0

Try with this:

\documentclass{article}
\usepackage{multirow,array,booktabs}

\begin{document}
\begin{table}
  \centering
%  \setlength{\tabcolsep}{.14cm} % Abstand zwischen den Spalten einer 
Tabelle
\caption{babalaba.}
\begin{tabular}{ccc!{\vrule width 0.2em}c}
    \specialrule{0.2em}{0em}{0em}
{L1}&{Linkers}&{L3}&{Dyes} \\
    \specialrule{0.2em}{0em}{0em}
 RNA1 & \multirow{2}{*}[-0.72ex]{cL}&{D dye}\\
 blabla & & {D dye}\\
    \specialrule{0.2em}{0em}{0em}
\end{tabular}
\label{table1}
\end{table}
\end{document}
1
  • Unfortunately, the lines are too tight.
    – Mathy
    Commented Aug 3, 2017 at 9:32

You must log in to answer this question.

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