Graphics, Figures & TablesLeft Border missing in colored Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
veroaero
Posts: 1
Joined: Thu Jul 21, 2011 3:51 am

Left Border missing in colored Table

Post by veroaero »

Hello,

I would really appreciate if someone can help me here. I am using the colortbl package to generate a table and the left border is missing and I have no clue how to get it back.

Here is my code:

Code: Select all

\begin{table}[!bht]
\begin{center}
\newcommand{\CTPanel}[1]{% 
\multicolumn{1}{>{\columncolor{white}}l|}{#1}}
\newcommand{\CXPanel}[1]{% 
\multicolumn{1}{>{\columncolor{USCgold}}c|}{#1}}
\newcommand{\CGRPanel}[1]{% 
\multicolumn{1}{>{\columncolor{USCmaroon}}l|}{#1}}
\newcommand{\CGRRPanel}[1]{% 
\multicolumn{1}{>{\columncolor{USCgrey2}}l|}{#1}}
\newcommand{\CGPanel}[1]{% 
\multicolumn{1}{>{\columncolor{lawngreen}}l|}{#1}}
\setlength\fboxsep{3mm} \colorbox[cmyk]{0,0,0,0.15}{%
\begin{tabular}{lc|cc} 
\hline 
\CXPanel{Water content} & \CTPanel{--} & \CTPanel{Medium} & \CTPanel{Full} \\
\hline 
\CXPanel{Air content} & \CTPanel{--} & \CTPanel{Medium} &\CTPanel{Large}\\
\hline 
\hline 
\CXPanel{Sample thickness} & \CTPanel{1/4"} & \CTPanel{1/2"} & \CTPanel{3/4"}\\
\hline 
\CXPanel{Loading conditions} & \CTPanel{--} & \CTPanel{Compression} &\CTPanel{Tension}\\
\hline 
\CXPanel{Notch width} & \CTPanel{0.02 inch} & \CTPanel{0.08 inch} & \CTPanel{>0.2 inch}\\
\hline 
\CXPanel{Notch direction} & \CTPanel{Horizontal} & \CTPanel{Vertical} & \CTPanel{Mixed or none}\\
\hline 
\CXPanel{Type of material} & \CTPanel{Plastic} & \CTPanel{Concrete/Metal} & \CTPanel{Composite}\\
\hline 
\hline 
\CXPanel{Visualization technique} & \CTPanel{Schlieren$^{\dagger}$} & \CTPanel{Photoelasticity$^{\dagger}$} &\CTPanel{Caustics}\\
\hline 
\end{tabular}}
\end{center}
\caption{Experimental subtasks. $^{\dagger}$Can be simultaneous.}
\label{table:1}
\end{table}%
Thanks in advance,
Veronica

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

toastermm
Posts: 8
Joined: Wed Feb 02, 2011 5:37 pm

Left Border missing in colored Table

Post by toastermm »

I believe you lost your left column when you defined your \CXPanel (the one you use on the left of your table).

Instead of :

Code: Select all

\newcommand{\CXPanel}[1]{%
\multicolumn{1}{>{\columncolor{USCgold}}c|}{#1}}
Use :

Code: Select all

\newcommand{\CXPanel}[1]{%
\multicolumn{1}{|>{\columncolor{USCgold}}c|}{#1}}
If you can't see the difference, there is an extra 'bar' character (shift slash key) before the column color.

USC gold huh? :D
Post Reply