Graphics, Figures & TablesCell Color overlays Table Rules

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
SML
Posts: 2
Joined: Fri Feb 15, 2013 2:15 pm

Cell Color overlays Table Rules

Post by SML »

Hello,

I am unable to view the borders of the table in the PDF output (only in the rows where the colour has been filled). I am using the following code:

Code: Select all

\begin{table}[htp]
\caption{Statistics}
\begin{center}
\setlength{\arrayrulewidth}{0.5pt}
\begin{tabular}  {|p{3.5cm}|   p{1.5cm}|   p{1.5cm}|   p{1.8cm}|   p{1.8cm}|     >{\centering\arraybackslash}p{2.2cm}|}
\hline  \rowcolor[gray]{.8} 
 \textbf{Parameters} & \multicolumn{2}{>{\columncolor[gray]{.8}}c|}{\textbf{Value}} & \multicolumn{2}{>{\columncolor[gray]{.8}}c|}{\textbf{value $\pm$ sem}}  &  \textbf{n} \\
\hline
&  \textbf{Control} &  \textbf{Test} &  \textbf{Control} &  \textbf{Test}   & \\
\hline  
 \multicolumn{6}{|>{\columncolor[gray]{.8}}l|}{\textbf{XYZ}}\\
\hline
\multicolumn{6}{|>{\columncolor[gray]{.8}}l|}{\textbf{analysis ($\%$XYZ$>$5) some text}}\\
\hline

{test} & {14.50} & {14.49} & {14.3$\pm$0.6} & {16.4$\pm$2}   & {$0.7302$}\\
\hline
{test} & {0.10} & {0.13} & {0.11$\pm$0.02} & {0.13$\pm$0.02}   & {$0.8057$}\\
\hline
{test} & {72.50} & {24.00} & {66.8$\pm$9.3} & {45.2$\pm$16.6}   & {$0.4127$}\\
\hline
{test} & {21.50} & {21.00} & {23.3$\pm$5.2} & {25$\pm$7}   & {$0.9048$}\\
\hline
{test} & {8.00} & {32.00} & {9.8$\pm$5} & {30$\pm$13}   & {$0.3873$}\\
\hline
{test} & {0.57} & {0.53} & {0.55$\pm$0.11} & {0.45$\pm$0.07}   & {$0.5556$}\\
\hline
{test} & {0.45} & {0.33} & {0.44$\pm$0.07} & {0.32$\pm$0.03}   & {$0.2857$}\\
\hline
\end{tabular} \\
\end{center}
\label{table}
\end{table}%
Would be very happy if anyone helps me to solve this issue!

Thanks,
SML

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Cell Color overlays Table Rules

Post by localghost »

Either view the printed output or zoom a bit in your PDF viewer. If that doesn't help, please prepare a self-contained and minimal example to give an adequate problem description.


Best regards and welcome to the board
Thorsten
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Cell Color overlays Table Rules

Post by mas »

I compiled your code fragment and can see the borders/rules clearly. The viewers I checked are xpdf, atril, evince and acroread. As suggested, you can try increasing the zoom level and check.

One suggestion about your table entries: Rather than typing {14.3$\pm$0.6}, type it as {$14.3\pm 0.6$}. The spacing will be more pleasing and follows the proper math conventions. In addition using siunitx, will result in a better looking table.

Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
SML
Posts: 2
Joined: Fri Feb 15, 2013 2:15 pm

Re: Cell Color overlays Table Rules

Post by SML »

Hello,

Thanks to both of you!!
As you suggested, I am able to see the borders when I zoom more than 300%.. I am using Adobe acrobat 9 pro.. I will try to print as well..

Thanks for the suggestion regarding siunitx.. I am trying this right now!

Best wishes,
SML
Post Reply