# how can I predefine the color of multicolumns?

I'm trying to use multicolum. In my table all the columns have a predefined color which will be overwritten by multicolum. So my question is how can I define own or some more custom multicolumn commands which will make it able to set the color of the column faster than writing:

``````\multicolumn{3}{|>{\columncolor[gray]{.8}} c|}{myText}
``````

I tried something like this:

``````\renewcommand{\multicolumn}[3]{%
\oldmc{##1}{| {\columncolor[gray]{.8}[.5\tabcolsep] } c |  ##2}{ ##3 }% }}
``````

But I think there are some problems with the syntax, as I don't get it working.

-
Welcome to TeX.SX. Note that you don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Claudio Fiandrino Feb 7 '13 at 18:22
@user25646 It looks like you've got two separate accounts: this one and one older unregistered one. The StackExchange staff can merge them together for you. –  Joseph Wright Feb 8 '13 at 15:16
thx, for the advice –  user1234567890 Feb 9 '13 at 4:29

Load package `array`

``````\usepackage{array}
``````

define a new column type (say `Q`)

``````\newcolumntype{Q}{|>{\color[gray]{.8}} c|}
``````

then use

``````\multicolumn{3}{Q}{myText}
``````
-
Which is surely better than redefining `\multicolumn`, of course. `:-)` –  egreg Feb 7 '13 at 18:52