Graphics, Figures & Tablestoo short vertical lines

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
theoglad
Posts: 1
Joined: Fri Mar 05, 2021 7:35 pm

too short vertical lines

Post by theoglad »

Hello,

As you can see on my screenshot, my vertical lines are too short and stop right in the middle of my first line. Do you have any idea what I'm doing wrong? I put my code just below.

Thanks in advance!

Theo

Code: Select all

    \[table] [h!]
    \centering
    \caption [name in the list in tables]{legende}
    \label{tab:inventory}
    \begin{tabular}{@{}l|l|r|r|r|r|r|r@{}}
        \toprule
        \textbf{Post} & \textbf{Equipment} & \textbf{Unit} & \textbf{Common} & \textbf{LLN} & \textbf{Woluwe} & \textbf{Mons} & \textbf{Tournai} & \textbf{St-Gilles} & \textbf{Charleroi} & \textbf{Uncertainty} \\
        \Xhline{2.5pt}
        \multirow{4}{22mm}{test} & test & test & test & test & test & test & test & test & test & test \
         & test & test & test & test & test & test & test & test & test & test
         & test & test & test & test & test & test & test & test & test & test
         & test & test & test & test & test & test & test & test & test & test
        \bottomrule
    \end{tabular}
\end{table}
Attachments
Capture d’écran 2021-03-05 à 18.39.27.png
Capture d’écran 2021-03-05 à 18.39.27.png (24.83 KiB) Viewed 4225 times
Last edited by Stefan Kottwitz on Thu Mar 11, 2021 2:59 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

too short vertical lines

Post by Bartman »

Please create a complete Infominimal working example and use the Code button or the code tags directly.

You use more columns than you defined.

As you can read in the documentation of the booktabs package, it is not recommended to use it together with vertical lines.

I'd like to propose the following changes to you:

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage[hmargin=2.5cm, showframe]{geometry}
\usepackage{xcolor}
\usepackage[singlelinecheck=off, labelfont={color=magenta}]{caption}
\usepackage{booktabs}
\usepackage{multirow}

\addto\captionsenglish{\renewcommand{\tablename}{Tab.}}
\AtBeginDocument{\renewcommand{\thetable}{\thesection.\arabic{table}.}}

\counterwithin{table}{section}

\begin{document}
\listoftables
\appendix
\section{Section in appendix}
\begin{table}[h!]
    \centering
    \scriptsize
%    \setlength{\cmidrulewidth}{2.5pt}
    \caption[name in the list of tables]{legende}
    \label{tab:inventory}
    \begin{tabular}{ll *9r}
    \toprule
    \textbf{Post} & \textbf{Equipment} & \textbf{Unit} & \textbf{Common} 
    & \textbf{LLN} & \textbf{Woluwe} & \textbf{Mons} & \textbf{Tournai} 
    & \textbf{St-Gilles} & \textbf{Charleroi} & \textbf{Uncertainty} \\
%    \midrule%[2.5pt]
    \cmidrule(lr){1-3}
    \cmidrule(lr){4-11}
    \multirow{4}{*}{test} & test & test & test & test & test & test & test & test 
                          & test & test \\
                          & test & test & test & test & test & test & test & test 
                          & test & test\\
                          & test & test & test & test & test & test & test & test 
                          & test & test\\
                          & test & test & test & test & test & test & test & test 
                          & test & test\\
    \bottomrule
    \end{tabular}
\end{table}
\end{document}
You may find the examples of tabsatz useful when designing tables.
Post Reply