Graphics, Figures & TablesMissing vertical line

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Mila100
Posts: 1
Joined: Thu Jul 31, 2014 11:21 pm

Missing vertical line

Post by Mila100 »

I am new to Latex and I have tried to create a table but one vertical line is missing :(

here is the code

Code: Select all

\begin{table*}[t]
  \centering
  \begin{center}
   \begin{tabular}{|r|l|c|c|c|}
    \hline &&\multicolumn{3}{c}{\bf Results}\\
    \hline\bf Nr.& \bf Features&\bf Strict &\bf Outer &\bf Inner\\ \hline
    1&Morphological F.&100.00&100.00&100.00\\
    2&1 + Bla &100.00&100.00&100.00\\
    3&2 + Blabla&100.00&100.00&100.00\\
    4&3 + blablabla&100.00&100.00&100.00\\
    5&4 + blablablabla&100.00&100.00&100.00\\
    \hline
   \end{tabular}
  \end{center}
  \caption{\label{font-table} Results. }
  \label{tab:1}
\end{table*}
The vertical line is missing here in the first raw after Results :oops:

And can you tell me how can I delete first two empty cells?

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Missing vertical line

Post by Johannes_B »

You shouldn't use vertical lines in tabular material. Please have a look at package booktabs.

Code: Select all

\documentclass{article}
\usepackage{booktabs}
\usepackage{blindtext}
\begin{document}
\begin{table*}
	\centering
%	\begin{center}%JB: Leave that out
	\begin{tabular}{|r|l|c|c|c|}
		\hline &&\multicolumn{3}{c|}{\bf Results}\\%JB: mind the bar 
		\hline\bf Nr.& \bf Features&\bf Strict &\bf Outer &\bf Inner\\ \hline
		1&Morphological F.&100.00&100.00&100.00\\
		2&1 + Bla &100.00&100.00&100.00\\
		3&2 + Blabla&100.00&100.00&100.00\\
		4&3 + blablabla&100.00&100.00&100.00\\
		5&4 + blablablabla&100.00&100.00&100.00\\
		\hline
	\end{tabular}
%	\end{center}
	\caption{\label{font-table} Results. }
	%JB: Why are you setting the label twice?
	\label{tab:1}
\end{table*}

\blindtext

\begin{table}
	\centering
	\begin{tabular}{rlccc}
		\toprule &&\multicolumn{3}{c}{ Results}\\
		\cmidrule{3-5}
		Nr.      & Features         & Strict & Outer  & Inner\\
		\midrule
		1         & Morphological F. & 100.00 & 100.00 & 100.00\\
		2         & 1 + Bla          & 100.00 & 100.00 & 100.00\\
		3         & 2 + Blabla       & 100.00 & 100.00 & 100.00\\
		4         & 3 + blablabla    & 100.00 & 100.00 & 100.00\\
		5         & 4 + blablablabla & 100.00 & 100.00 & 100.00\\
		\bottomrule
	\end{tabular}
	\caption{Tabular material using booktabs}
\end{table}
\end{document}
BTW: \bf is obsolete, use \bfseries instead.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply