2

I want horizontal lines between each row in the table. I use this code for the table. However, it shows only vertical lines.

Here is my code(Please ignore the values inside table)

\begin{table}[h]
\caption{Comparison of Accuracy, Precision and Recall}
\label{table_example}
\begin{tabular}{|c||c|c|c|c|c|c|}
\hline
Method & Accuracy & Precision & Recall \\
\hline
Author 1 (2019) & 97.93 & 76.72 & 76.72\\
\hline
Author 2 (2017) & 93.36 & 0.78 & 76.72\\
\hline
Author 3 (2019) & 0.91 & 0.90 & 76.72\\
\hline
Author 4 (2019) & 0.91 & 0.90 & 76.72\\
\hline
Author 5 (2018) & 0.91 & 0.90 & 76.72\\
\hline
Author 6 & 0.91 & 0.90 & 76.72\\
\hline
\end{tabular}
\end{table}

This is how it shows up. I tried using other browsers to view it, yet there are no horizontal lines. enter image description here


Addendum: Here's what is in the preamble:

\documentclass[conference]{IEEEtran}
\usepackage[pdftex]{graphicx} 
\graphicspath{{../pdf/}{../jpeg/}} 
\DeclareGraphicsExtensions{.pdf,.jpeg,.png} 
\usepackage[cmex10]{amsmath} 
\usepackage{tabularx} 
\usepackage{colortbl} 
\usepackage{mathabx} 
\usepackage{algorithmic} 
\usepackage{array} 
\usepackage{mdwmath} 
\usepackage{mdwtab} 
\usepackage{eqparbox} 
\usepackage{url}

Edit- [SOLVED] by removing the mdwtab package

BOO1210
  • 53
  • 1
  • 6
  • 1
    Please make your code compilable. Which documentclass do you use? Do you get any error messages? – leandriis May 08 '20 at 06:29
  • 1
    Could it be possible that the arrayrulecolor was changed to white? – leandriis May 08 '20 at 06:30
  • It can be certainly a rendering problem. Either zoom the table in your browser or print it to see if the lines are really printed. – loved.by.Jesus May 08 '20 at 06:31
  • document class is conference{IEEEtran}, I've used package tabularx I tried changing browsers, with same results arrayrulecolor wasn't defined by me, but I used a PDF reader with black backgroud but it still didn't show horizontal lines – BOO1210 May 08 '20 at 06:34
  • 3
    The gaps in the vertical lines indicate the \hlines are present but white, but maybe something redefined \hline. The error is in the stuff left out of the question. Provide a short but complete sample document. – Donald Arseneau May 08 '20 at 06:36
  • If the \hlines were present, they would have shown up when using a dark background, wouldn't they? They are n't showing up there either, but the vertical lines are. Unfortunately, I wouldn't be able to share the whole document, I don't think I'm allowed to. But I could provide whatever I can. Do I need to share which packages I have used? Also, \hline has worked for me previously. – BOO1210 May 08 '20 at 06:39
  • Welcome to TeX.SE. I am also unable to replicate the issue you're experiencing, while using \documentclass[conference]{IEEEtran}. As others have already commented as well, the issue must be due to document setup aspects you haven't disclosed so far. Do tell us which packages are loaded in the preamble -- and in which order. – Mico May 08 '20 at 06:56
  • \usepackage[pdftex]{graphicx}

    \graphicspath{{../pdf/}{../jpeg/}}

    \DeclareGraphicsExtensions{.pdf,.jpeg,.png}

    \usepackage[cmex10]{amsmath}

    \usepackage{tabularx}

    \usepackage{colortbl}

    \usepackage{mathabx}

    \usepackage{algorithmic}

    \usepackage{array}

    \usepackage{mdwmath}

    \usepackage{mdwtab}

    \usepackage{eqparbox}

    \usepackage{url}

    Are used in the document, in the same order

    – BOO1210 May 08 '20 at 07:00
  • @BOO1210 - I've taken the liberty of copying the code in your comment into the body of your query. – Mico May 08 '20 at 07:26

2 Answers2

5

You report that the preamble loads both the mdwtab package and the colortbl package. There appears to be an unfortunate [!] interaction between these packages that causes the lines drawn by \hline to be rendered in white and hence become invisible. As soon as you stop loading either the mdwtab package or the colortbl package, the horizontal lines reappear.

You need to decide if you can live without the mdwtab and/or colortbl packages (or both!). If you can, the problem will be solved.

In the following MWE (minimum working example), the problem is solved by not loading the mdwtab and mdwmath packages.

enter image description here

\documentclass[conference]{IEEEtran}
\usepackage[pdftex]{graphicx} 
\graphicspath{{../pdf/}{../jpeg/}} 
\DeclareGraphicsExtensions{.pdf,.jpeg,.png} 
\usepackage[cmex10]{amsmath} 
\usepackage{tabularx} 
\usepackage{colortbl} 
\usepackage{mathabx} 
\usepackage{algorithmic} 
%\usepackage{array} % is loaded automatically by 'tabularx'
% The next two packages haven't been updated in decades
%%%\usepackage{mdwmath} 
%%%\usepackage{mdwtab} 
\usepackage{eqparbox} 
\usepackage{url}

\begin{document}
\begin{table}
\centering
\setlength\extrarowheight{1pt}
\caption{Comparison of Accuracy, Precision and Recall}
\label{table_example}
\begin{tabular}{|l||c|c|c|c|c|c|}
\hline
Method & Accuracy & Precision & Recall \\
\hline
Author 1 (2019) & 97.93 & 76.72 & 76.72\\
\hline
Author 2 (2017) & 93.36 & 0.78 & 76.72\\
\hline
Author 3 (2019) & 0.91 & 0.90 & 76.72\\
\hline
Author 4 (2019) & 0.91 & 0.90 & 76.72\\
\hline
Author 5 (2018) & 0.91 & 0.90 & 76.72\\
\hline
Author 6 & 0.91 & 0.90 & 76.72\\
\hline
\end{tabular}
\end{table}
\end{document}
Mico
  • 506,678
  • I had not orignially included the colortbl package, but did so when trying out the solution given by @loved.by.jesus. HOWEVER, removing mdwtab solved it. Thank you so much! – BOO1210 May 08 '20 at 07:46
2

In order to see, if is a colour or thickness problem (white lines or too thin to see) do following: (as described in this line colour question) and line thickness question Load the package \usepackage{colortbl} for colour Load the package \usepackage{makecell} for thickness

And write \arrayrulecolor{black}\hline and/Or \Xhline{5pt} instead of \hline

For example:

\usepackage{colortbl}
\usepackage{makecell}

...

\begin{table}[h]
\caption{Comparison of Accuracy, Precision and Recall}
\label{table_example}
\begin{tabular}{|c||c|c|c|c|c|c|}
\arrayrulecolor{black}\hline %Forcing black colour in the \hline
Method & Accuracy & Precision & Recall \\
\arrayrulecolor{black}\Xhline{5pt} %Forcing black colour and 5pt thickness
Author 1 (2019) & 97.93 & 76.72 & 76.72\\
\arrayrulecolor{blue}\hline %Forcing blue colour in the \hline
Author 2 (2017) & 93.36 & 0.78 & 76.72\\
\hline
Author 3 (2019) & 0.91 & 0.90 & 76.72\\
\hline
Author 4 (2019) & 0.91 & 0.90 & 76.72\\
\hline
Author 5 (2018) & 0.91 & 0.90 & 76.72\\
\hline
Author 6 & 0.91 & 0.90 & 76.72\\
\hline
\end{tabular}
\end{table}

You will then now, if it is one of both problem

  • 1
    Thank you for the suggestion, I tried using the package, but it didn't change anything. Still can't see the horizontal line on the Overleaf browser, Firefox and SumatraPDF – BOO1210 May 08 '20 at 06:51
  • Well, my last guess, try to make the line thicker, if something happens. ;) – loved.by.Jesus May 08 '20 at 07:01
  • 1
    Unfortunately, changing the line size and using Xhline didn't change anything :/ – BOO1210 May 08 '20 at 07:04
  • Nothing? Not even the gap between the vertical lines of the table? That sounds really weird. Do not give up, solution will come. Please try to give a Minimal Example. A full sample of code where the error occurs that it is as short as possible, so that people my try a possible solution. – loved.by.Jesus May 08 '20 at 07:07
  • Nope. Just the vertical lines are showing up. Here https://imgur.com/K0lGc8i – BOO1210 May 08 '20 at 07:09
  • 1
    The OP's issue was not caused by any of the possibilities you examine in this posting. Instead, it was caused by a rather unfortunate interaction between the colortbl and mdwtab packages. – Mico May 08 '20 at 07:28
  • @Mico, according to the comment of @BOO1210 above, it seems that it was mdwtab alone: unmaintained package. :\ – loved.by.Jesus May 08 '20 at 11:24