4

This question already has an answer here:

We are using XeLaTeX and the longtable package to visualize information, one of those reports must have a colored cell. A single cell, not the entire row.

An example output is here: Example of the colored cell

Is there a way to color a single cell when using long tables?

Update: example code:

\documentclass[10pt,a4paper,onside,article,notitlepage, landscape]{memoir}
\begin{document}
\vspace*{-4cm}

\section*{Leverlijst per week}

\begin{longtable}{p{2cm}p{4cm} p{2cm}p{2cm} p{4cm}p{4cm} p{2cm}p{3cm}}
Order ID & Referentie & Locatie & Klant & Tekeningnummer & Omschrijving & Leverdatum & Status \\ \hline
1234 & REFERENCE & Location & Client & Drawingnumber & Description & Deliveryday & Status
\end{longtable}
\end{document}

marked as duplicate by Werner tables Jun 11 '14 at 15:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    Use \usepackage{colortabl} and put \cellcolor{blue} <content> – user11232 Jun 11 '14 at 13:48
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jun 11 '14 at 14:06
  • @ChristianHupfer: Updated! – eirvandelden Jun 11 '14 at 14:54
  • Use \usepackage{color, colortbl} and \cellcolor{Goldenrod}. – Ľubomír Masarovič May 19 '17 at 18:39
5
\documentclass[10pt,a4paper,onside,article,notitlepage, landscape]{memoir}
\usepackage[table]{xcolor}
\usepackage{longtable}
\begin{document}

\begin{longtable}{*8l}
\rowcolor{blue!80!red!40}
Order ID & Referentie & Locatie & Klant & Tekeningnummer & Omschrijving & Leverdatum & Status \\ \hline
1234 & REFERENCE & Location & Client & Drawingnumber & Description & Deliveryday & 
  \cellcolor{red}Status
\end{longtable}
\end{document}

enter image description here

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