Ok, I want to create an environment that prepares my table in such a way that I have consistent results.
\documentclass[10pt]{article}
\usepackage[table]{xcolor}
\usepackage{graphics}
\usepackage{colortbl} %make alternating row colours
\usepackage{tabu} % \rowfont
\usepackage{multirow} % for multirow and multicol
\usepackage{booktabs}
\usepackage{hhline} %to make hlines over a certain number of columns
\usepackage{array} % adds more features on how tables are used
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} %left-align with specific size
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}%centre-align with specific size
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\rowcolors{2}{blue!15}{white}
\arrayrulecolor{blue}
\providecommand{\theader}{\rowfont{\color{white}}\rowcolor{blue}}
\newenvironment{myTable}[4][htbp]
{
\begin{table}[#1]
\begin{center}
\caption{#4}\label{#3}
\begin{tabu}{#2}
\hline
}{
\end{tabu}
\end{center}
\end{table}
}
\begin{document}
\begin{myTable}[htb]{*{4}{c |}|*{2}{C{1.5cm} |}| C{3cm}}%
{tbl:label}%
{Caption Text}
\theader$a$ & $b$ & $c$ & $d$ & $(a\land b)$ & $(c\land d)$ & $(a\land b)\lor(c\land d)$\\\hline
0 & 0 & 0 & 0 & 0 & 0 & 0\\
\multicolumn{4}{@{}c@{}}{\upbracefill} & \multicolumn{2}{@{}c@{}}{\upbracefill} & \upbracefill\\
\end{myTable}
\end{document}
I create an environment myTable that contains a table and tabu environment. However, whenever I use \multicolumn together with \rowcolor. I get the following compiler error:
! Emergency stop. \multispan ->\omit @multispan l.46 \end{myTable}
I had the same within a tabular environment and it worked fine. When I remove the multicolumn commands, it works fine. When I remove the rowcolor command, it works fine.
I can work around it by placing a \cellcolor{white} in each multicolumn command. But that's not a solution.
Does anybody has any ideas on how to fix it??? Any help is appreciated!
tabu
... Better switch over to normaltabular
withcolortbl
support....