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

9
  • 1
    Please make your code compilable. Which documentclass do you use? Do you get any error messages?
    – leandriis
    May 8, 2020 at 6:29
  • 1
    Could it be possible that the arrayrulecolor was changed to white?
    – leandriis
    May 8, 2020 at 6: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. May 8, 2020 at 6: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 8, 2020 at 6: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. May 8, 2020 at 6:36

2 Answers 2

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}
1
  • 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 8, 2020 at 7: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

7
  • 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 8, 2020 at 6:51
  • Well, my last guess, try to make the line thicker, if something happens. ;) May 8, 2020 at 7:01
  • 1
    Unfortunately, changing the line size and using Xhline didn't change anything :/
    – BOO1210
    May 8, 2020 at 7: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. May 8, 2020 at 7:07
  • 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 8, 2020 at 7:28

You must log in to answer this question.

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