Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to draw a simple colored table with 4 columns. First row is a multicolumn row which spans columns one and two. There is one doublespace between columns 2 and 3. When i apply color (blue in this case) to multicolumn 1&2 it actually crosses the doublerule separator which is not what I want.

Any ideas how to solve this?

Here is the code which produces the table.

\documentclass[12pt]{article}

\usepackage{colortbl}
\usepackage[margin=1in,headsep=2.5cm]{geometry}

\setlength{\textwidth}{500pt}
\setlength{\parindent}{0pt}
\setlength{\doublerulesep}{4pt}
\setlength{\extrarowheight}{3pt}

\begin{document}
\begin{tabular}
{ >{\columncolor[gray]{0.8}}b{79pt}
  >{\columncolor[gray]{0.8}}b{145pt}||
  >{\columncolor[gray]{0.8}}b{79pt} 
  >{\columncolor[gray]{0.8}}b{145pt}  }
\multicolumn{2}{>{\cellcolor{blue}}l}{SOME TEXT GOES HERE}& & \\
\textbf{E-mail:} & test@example.com & \textbf{Name:} & My Name\\
\hline \hline
\textbf{Date:} & 18.3.2011 & \textbf{ID number:} & 1234567\\
\end{tabular}
\end{document}

result

share|improve this question
    
I added a picture (and you should have enough reputation for pictures now). –  Caramdir Mar 18 '11 at 17:51
    
@Caramdir Thanks a lot :) –  user4268 Mar 18 '11 at 18:30

1 Answer 1

up vote 1 down vote accepted

You have to add || at the end of the second argument of \multicolumn as well.

\documentclass[12pt]{article}

\usepackage{colortbl}
\usepackage[margin=1in,headsep=2.5cm]{geometry}

\setlength{\textwidth}{500pt}
\setlength{\parindent}{0pt}
\setlength{\doublerulesep}{4pt}
\setlength{\extrarowheight}{3pt}

\begin{document}
\begin{tabular}
{ >{\columncolor[gray]{0.8}}b{79pt}
  >{\columncolor[gray]{0.8}}b{145pt}||
  >{\columncolor[gray]{0.8}}b{79pt} 
  >{\columncolor[gray]{0.8}}b{145pt}  }
\multicolumn{2}{>{\cellcolor{blue}}l||}{SOME TEXT GOES HERE}& & \\
\textbf{E-mail:} & test@example.com & \textbf{Name:} & My Name\\
\hline \hline
\textbf{Date:} & 18.3.2011 & \textbf{ID number:} & 1234567\\
\end{tabular}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.