Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

colortbl, cellcolor of multicolumn

114 views
Skip to first unread message

"Žarko F. Čučej"

unread,
Dec 7, 2013, 4:12:28 AM12/7/13
to
hi,
see mwe (colors are selected, that the problem is more obvious ...) below:

\documentclass[border=5mm]{standalone}
\usepackage{colortbl}
\begin{document}
\begin{tabular}{>{\color{white}\columncolor{green}[.5\tabcolsep]}c
>{\color{white}\columncolor{green}[.5\tabcolsep]}c
>{\columncolor{green}[.5\tabcolsep]}c
>{\columncolor{green}[.5\tabcolsep]}l}
\hline
$b_{15}$ & $b_{14}$ & $b_{13}$ -- $b_{0}$ & text\\
\hline
0 & \multicolumn{2}{c}{\cellcolor{blue}
$0_{10}$ -- $32767_{10}$} & text\\
1 & 0 & \cellcolor{red} 0 & text\\
1 & 1 & 0 & text
\end{tabular}
\end{document}

how to manage, that
1) color of multicolum cell will not be wider than column colors of
spanned columns, i.e. that cellcolor will be aware od columncolor
settings (repeating this settings at cellcolor as
\cellcolor{blue}[0.5\tabcolsep] gives error ...)?
2) contents of cell colored by cellcolor and other cell below/above
it will be in the same position (in shoved case in center of cell)?

regards, zarko

"Žarko F. Čučej"

unread,
Dec 7, 2013, 4:37:03 AM12/7/13
to
after reading documentation for colortbl again, i found solutions/got a
clue, how to solve mentioned problems:
1) instead of use \cellcolor in multicolum i should use
\multicolumn{2}{\multicolumn{2}{>{\columncolor{green}[.5\tabcolsep]}c}{$0_{10}$
-- $32767_{10}$}
2) instead of use
\cellcolor{red} <content of cell>
i sould use
\cellcolor{red}{<content of cell>}

regards, zarko


0 new messages