Graphics, Figures & TablesTop border on table does not appear in pdf

Information and discussion about graphics, figures & tables in LaTeX documents.
nustorms
Posts: 6
Joined: Mon Jan 12, 2009 5:29 pm

Top border on table does not appear in pdf

Post by nustorms »

I am working on my masters thesis and have made several tables previously. The one listed below looks fine in DVI, but when I put it into pdf the top line on rows 2-3 does not show up. At first I thought it was a resolution thing, but when I print it out in hardcopy, it is really not there.

Here is the code I am using for my table:

Code: Select all

\begin{table}
\centering \parbox{6in}{\caption{Comparison of features of inertial and satellite navigation systems~\cite{titwest} \label{tab:INSvsSAT}}} \\ \vspace{0.1in}
\begin{tabular}{p{1.5in}|p{1.75in}|p{1.75in}|}
\cline{2-3}

\LCC
 & \lightgray & \lightgray \\
 & Advantages & Disadvantages \rule{0in}{3ex} \\[1ex] \hline
\ECC

\LCC
\lightgray & &\\
\multicolumn{1}{|c|}{\multirow{3}{*}{Inertial navigation systems}} & 
\multicolumn{1}{|p{1.5in}|}{High data rate} & Unbounded errors\rule{0in}{3ex}\\ 
\multicolumn{1}{|p{1.5in}|}{} & Provides translational and rotational data & Knowledge of gravity required \\ 
\multicolumn{1}{|p{1.5in}|}{} & Not able to be jammed or spoofed &  \\ \cline{1-3}
\multicolumn{1}{|c|}{\multirow{3}{*}{Satellite navigation systems}} & 
\multicolumn{1}{|p{1.5in}|}{Errors are bounded} & Low data rate\\
\multicolumn{1}{|p{1.5in}|}{} & & No attitude information \\
\multicolumn{1}{|p{1.5in}|}{} & & Able to be jammed and spoofed \\[1ex] \cline{1-3}
\ECC
\end{tabular}
\end{table}
I have several other tables in my document that work, so any help is greatly appreciated.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Top border on table does not appear in pdf

Post by localghost »

Your code is not compilable and so the problem not comprehensible for me because of some unknown commands. Please provide a minimal working example (MWE) that shows the undesired effect.


Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
nustorms
Posts: 6
Joined: Mon Jan 12, 2009 5:29 pm

Re: Top border on table does not appear in pdf

Post by nustorms »

So after digging through my code some more. The problem is with using colortab and \cline. It looks as though the colortab package overwrites color onto the \cline. Is there a work around for this? This code is as minimal as I can get. It uses packages colortab and multirow.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Top border on table does not appear in pdf

Post by localghost »

nustorms wrote:[...] This code is as minimal as I can get. It uses packages colortab and multirow.
Please follow the link in my last reply and learn what a MWE really is. Afterwards supplement the code you gave to a compilable code example. Don't forget to insert the definitions of commands like \LCC or \ECC which are not provided by the mentioned packages. Otherwise it will be impossible to give specific help.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
nustorms
Posts: 6
Joined: Mon Jan 12, 2009 5:29 pm

Top border on table does not appear in pdf

Post by nustorms »

Alright, let me try this again. The missing piece for the \LCC and \ECC was the \usepackage{pstricks}. Anyways, here is a comilable version of the code. Notice the top line does not appear over the Two upper most cells (Advantages and Disadvantages), if I do not shade the boxes the lines appear, but I want the shading, hence the problem.

Code: Select all

\documentclass[11pt,a4paper,oneside]{report}
\usepackage{multirow}
\usepackage{colortab}
\usepackage{pstricks}

\begin{document}
\begin{table}
\centering \parbox{6in}{\caption{Comparison of features of inertial and satellite navigation systems \label{tab:INSvsSAT}}} \\ \vspace{0.1in}
\begin{tabular}{p{1.5in}|p{1.75in}|p{1.75in}|}\cline{2-3}

\LCC
 & \lightgray & \lightgray \\
 & Advantages & Disadvantages \rule{0in}{2.5ex} \\[1ex] \hline
\ECC
\LCC
\lightgray & &\\
\multicolumn{1}{|c|}{\multirow{3}{*}{Inertial navigation systems}} & 
\multicolumn{1}{|p{1.5in}|}{High data rate} & Unbounded errors\rule{0in}{3ex}\\
\multicolumn{1}{|p{1.5in}|}{} & Provides translational and rotational data & Knowledge of gravity required \\ 
\multicolumn{1}{|p{1.5in}|}{} & Not able to be jammed or spoofed &  \\ \hline
\multicolumn{1}{|c|}{\multirow{3}{*}{Satellite navigation systems}} & 
\multicolumn{1}{|p{1.5in}|}{Errors are bounded} & Low data rate\\
\multicolumn{1}{|p{1.5in}|}{} & & No attitude information \\
\multicolumn{1}{|p{1.5in}|}{} & & Able to be jammed and spoofed \\[1ex] \cline{1-3}
\ECC 
\end{tabular}
\end{table}

\end{document}
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Top border on table does not appear in pdf

Post by localghost »

This is still not a MWE because it doesn't compile without errors. Please add the definitions of the \ECC and the \LCC command. These commands come neither from the pstricks package nor from the obsolete colortab package. I suggest that you compile this code on your machine to give us a picture of what you have done and attach the resulting output here to your next post. It sure will be possible to get the desired result with up-to-date packages.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Top border on table does not appear in pdf

Post by phi »

At least for the "newest" (1993) version of colortab \LCC and \ECC are defined in line 127:

Code: Select all

\def\LCC#1\\#2\ECC{\CC@{\@preamble}{#1}{#2}}
And the code does compile, giving the described result.
However, I agree with you that the best thing would be to switch to colortbl or xcolor, as suggested by the CTAN description.
nustorms
Posts: 6
Joined: Mon Jan 12, 2009 5:29 pm

Re: Top border on table does not appear in pdf

Post by nustorms »

Thanks phi. At least I am not completely losing my mind over here. I will try to use the colortbl package or xcolor to see what happens.
nustorms
Posts: 6
Joined: Mon Jan 12, 2009 5:29 pm

Top border on table does not appear in pdf

Post by nustorms »

Just to help anyone that runs into a similar problem. The answer is \hhline, which needs the package of the same name. The problem is with the way \cline works and it shows up with the colortbl package as well. If interested, the attached links can shed some light from someone much smarter than me and interested in broadening people's knowledge [1,2]. Again, phi, thank you for the positive push in the correct direction.

[1] CTAN: package information - colortbl
[2] CTAN: package information - hhline
mbing
Posts: 1
Joined: Tue Mar 17, 2009 9:54 pm

Top border on table does not appear in pdf

Post by mbing »

Good day.

I apologize for my bad English.

I have the same problem. The problem partly solved hhline, but hhline{-~-} drew a black line, white line (space) and the black line. White line on a colored background can not be.

Is there something I can do better colors, combining columns, connecting lines, like Excel? As the boxes in the table?
Post Reply