0

I have the following preamble:

\documentclass{article}

\usepackage{colortbl}
\usepackage[table]{xcolor}
\usepackage[many]{tcolorbox}
\usepackage{efbox}

\efboxsetup{linecolor=fucsia!100, linewidth=0.96pt, margin=0pt}

\definecolor{fucsia}{RGB}{196,0,98}

\begin{document}

\arrayrulecolor{fucsia}
\efbox{\begin{tabular}{l|l|}
\multicolumn{2}{l|}{\textbf{text 1}} \\
\hline
 & plays an instrument \\
\cline{2-2}
A musician & gives a recital / a concert / \\
&  a performance.\\
\cline{2-2}
 & performs / plays a piece. \\
\hline
A composer & composes / writes music. \\
\hline
A singer & performs / sings a song / an aria. \\
\hline
\multicolumn{1}{l|}{A conductor} & conducts an orchestra. \\
\hline
\multicolumn{2}{l|}{\textbf{text 2}} \\
\hline
 & pains a picture / a painting / \\
 &  a portrait.\\
\cline{2-2}
An artist / & draws a picture. \\
\cline{2-2}
A painter & does a sketch. \\
\cline{2-2}
 & creates a work (of art) \\
\hline
A sculptor & creates / makes / sculpts a work / \\
 & a sculpture / a piece / a bust. \\
\hline
\multicolumn{2}{l|}{\textbf{text 3}} \\
\hline
A novelist & writes novels / fiction. \\
\hline
A writer & writes novels / books / short stories. \\
\hline
A poet & writes poems / poetry. \\
\hline
A playwright & writes plays / tragedies / comedies. \\
\hline
A scriptwriter & writes screenplays (for films). \\
\hline
\multicolumn{2}{l|}{\textbf{text 4}} \\
\hline
An actor / & acts in / appears in / performs in \\
An actress & stars in / has a role in \\
 & a play / a production / a film / \\
 &  a musical.\\
\hline
A director & directs a play / a production / a film \\
 & a musical. \\
\hline
A drama & stages / puts on / performs a play / \\
company & a production / a musical. \\
\hline
\end{tabular}}

\end{document}

I'd like to add colours to the cells text 1, text 2, text 3 and text 4. I tried \rowcolor{} but it doesn't work.

  • Did you try add \cellcolor{>color>} into cells, which you like to have colored? – Zarko Apr 4 '16 at 18:45
2

A solution with simple \columncolors. I took the opportunity to improve vertical padding of rows with the cellspace package, and grouped some rows with makecell::

\documentclass{article}

\usepackage{colortbl}
\usepackage[table, x11names]{xcolor}
\usepackage[many]{tcolorbox}
\usepackage{efbox}

\efboxsetup{linecolor=fucsia!100, linewidth=0.96pt, margin=0pt}

\definecolor{fucsia}{RGB}{196,0,98}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\usepackage{multirow, makecell}
\renewcommand\cellalign{lc}

\begin{document}

\arrayrulecolor{fucsia}\efbox{\begin{tabular}{Sl|Sl|}
\multicolumn{2}{>{\columncolor{Bisque1!40}}Sl|}{\textbf{text 1}} \\
\hline
 & plays an instrument \\
\cline{2-2}
A musician & \makecell{gives a recital / a concert / \\
 a performance.}\\
\cline{2-2}
 & performs / plays a piece. \\
\hline
A composer & composes / writes music. \\
\hline
A singer & performs / sings a song / an aria. \\
\hline
\multicolumn{1}{l|}{A conductor} & conducts an orchestra. \\
\hline
\multicolumn{2}{>{\columncolor{Bisque1!40}}Sl|}{\textbf{text 2}} \\
\hline

\multirowcell{5}{An artist / \\ A painter} & \makecell{ pains a picture / a painting / \\
 a portrait.}\\
\cline{2-2}& draws a picture. \\
\cline{2-2}
& does a sketch. \\
\cline{2-2}
& creates a work (of art) \\
\hline
A sculptor & \makecell{creates / makes / sculpts a work / \\
 a sculpture / a piece / a bust.} \\
\hline
\multicolumn{2}{>{\columncolor{Bisque1!40}}Sl|}{\textbf{text 3}} \\
\hline
A novelist & writes novels / fiction. \\
\hline
A writer & writes novels / books / short stories. \\
\hline
A poet & writes poems / poetry. \\
\hline
A playwright & writes plays / tragedies / comedies. \\
\hline
A scriptwriter & writes screenplays (for films). \\
\hline
\multicolumn{2}{>{\columncolor{Bisque1!40}}Sl|}{\textbf{text 4}} \\
\hline
\makecell{An actor / \\ An actress} & \makecell{acts in / appears in / performs in \\
 stars in / has a role in \\
  a play / a production / a film / \\
   a musical.}\\
\hline
A director & \makecell{directs a play / a production / a film \\
   a musical}. \\
\hline
\makecell{A drama \\ company} & \makecell{stages / puts on / performs a play / \\
 a production / a musical.} \\
\hline
\end{tabular}}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.