Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to set the background colors for cells to indicate their relations. How can I do this in ConTeXt?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Depends on which table macros you are using (\starttabe, \starttabulate or \bTABE/\startTABLE). I will assume \bTABLE, because that is the most versatile option.

Each cell of a TABLE is a \frame, so it takes all the options of a \frame. You can color the background of a frame using

\frame[background=color, backgroundcolor=red]{...}

The same syntax works for TABLEs. You can either pass the color the a specific cell manually,

\bTABLE[background=color]
 \bTR 
    \bTD one   \eTD 
    \bTD two   \eTD
    \bTD three \eTD
 \eTR
 \bTR 
    \bTD[backgroundcolor=red] one   \eTD 
    \bTD two   \eTD
    \bTD three \eTD
 \eTR
\eTABLE

or use setups to select the cell

\setupTABLE[1][2][background=color,backgroundcolor=red]
% col 1 row 2

\bTABLE
 \bTR 
    \bTD one   \eTD 
    \bTD two   \eTD
    \bTD three \eTD
 \eTR
 \bTR 
    \bTD one   \eTD 
    \bTD two   \eTD
    \bTD three \eTD
 \eTR
\eTABLE
share|improve this answer
    
Both displays as black-and-white tables. –  Maciej Piechotka Nov 16 '10 at 10:47
    
If you are using mkii, you need to add \setupcolors[state=start] to get colors. –  Aditya Nov 16 '10 at 13:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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