Newbie question: background color in single table row
All - I have a simple table which looks like this: \placetable[here]{none} \starttable[|c w(3.0cm)|c|c w(2.75cm)|c w(7.0cm)|] \HL \VL \bf Name \VL \bf Location \VL \bf Date \VL \bf Signature \VL \AR \HL \VL \VL \VL \VL \VL \AR \HL \stoptable I would like to add a background color to the first row only. I tried \CL[colorname], \BR[colorname] and neither gets quite what I want. Is there a simple way to set the background color for only the first row? I have only just started using ConTeXT, never used TeX or LaTeX before, so I'm still trying to understand everything I read in the manuals, and searching the list archive. I can not seem to make the more HTML-ish tables work the way I want (e.g, \bTABLE...\eTABLE) so I'd like to be able to get where I want to go using the table I have. -- Mark Almeida mark.almeida@sun.com Solutions Architect (707)398-9524/x81132 Sun Client Solutions (707)429-0341 Home Office (707)480-5038 Cell Powered by Solaris 10_x86/Evolution 1.4.6
Welcome ! The Wizard wrote:
All - I have a simple table which looks like this:
skipped some code
I would like to add a background color to the first row only. Try this minimal example (tested on live.contextgarden.net):
\starttext \setupcolors[state=start] \placetable[here]{none} \starttable[|c w(3.0cm)|c|c w(2.75cm)|c w(7.0cm)|] \HL \CL[green]\AR \VL \bf Name \VL \bf Location \VL \bf Date \VL \bf Signature \VL \AR \HL \VL \VL \VL \VL \VL \AR \HL \stoptable \stoptext
I have only just started using ConTeXT, never used TeX or LaTeX before, so I'm still trying to understand everything I read in the manuals, and searching the list archive. I can not seem to make the more HTML-ish tables work the way I want (e.g, \bTABLE...\eTABLE) so I'd like to be able to get where I want to go using the table I have.
You missed the wiki: http://wiki.contextgarden.net and in particular Guiseppe Bilotta contribution on TaBlE, less than one day old :-) : http://wiki.contextgarden.net/Table Happy ConTeXting, SeR
On Mon, 2005-09-19 at 17:54, Sebastian Rooks wrote:
Welcome !
The Wizard wrote:
All - I have a simple table which looks like this:
skipped some code
I would like to add a background color to the first row only. Try this minimal example (tested on live.contextgarden.net):
\starttext \setupcolors[state=start] \placetable[here]{none} \starttable[|c w(3.0cm)|c|c w(2.75cm)|c w(7.0cm)|] \HL \CL[green]\AR \VL \bf Name \VL \bf Location \VL \bf Date \VL \bf Signature \VL \AR \HL \VL \VL \VL \VL \VL \AR \HL \stoptable \stoptext
I have only just started using ConTeXT, never used TeX or LaTeX before, so I'm still trying to understand everything I read in the manuals, and searching the list archive. I can not seem to make the more HTML-ish tables work the way I want (e.g, \bTABLE...\eTABLE) so I'd like to be able to get where I want to go using the table I have.
You missed the wiki: http://wiki.contextgarden.net
and in particular Guiseppe Bilotta contribution on TaBlE, less than one day old :-) : http://wiki.contextgarden.net/Table
Happy ConTeXting,
SeR
Sebastian - Thank you so much, that is exactly what I wanted. I am way behind the curve, trying to learn, and I have looked at the Wiki but I didn't see the new section. I will look at it. Thanks again. -- Mark Almeida mark.almeida@sun.com Solutions Architect (707)398-9524/x81132 Sun Client Solutions (707)429-0341 Home Office (707)480-5038 Cell Powered by Solaris 10_x86/Evolution 1.4.6
Sebastian Rooks wrote:
The Wizard wrote:
All - I have a simple table which looks like this:
skipped some code
I would like to add a background color to the first row only.
Try this minimal example (tested on live.contextgarden.net):
\starttext \setupcolors[state=start] \placetable[here]{none} \starttable[|c w(3.0cm)|c|c w(2.75cm)|c w(7.0cm)|] \HL \CL[green]\AR \VL \bf Name \VL \bf Location \VL \bf Date \VL \bf Signature \VL \AR \HL \VL \VL \VL \VL \VL \AR \HL \stoptable \stoptext
I have only just started using ConTeXT, never used TeX or LaTeX before, so I'm still trying to understand everything I read in the manuals, and searching the list archive. I can not seem to make the more HTML-ish tables work the way I want (e.g, \bTABLE...\eTABLE) so I'd like to be able to get where I want to go using the table I have.
The "same" \bTABLE ... \eTABLE construct could look like the one below (+ the formatting that you want for the remaining rows). However, you get visually different results, mostly different offsets (worse in \bTABLE than in \starttable, but \bTABLE has many other advantages). Width in \bTABLE ... \eTABLE is physical width, I suspect that in \starttable ... \stoptable it stands for the paragraph width, so that the table below is also much narrower. % row 1 \setupTABLE[r][1][style=bold,background=color,backgroundcolor=green,align=middle] \setupTABLE[c][1][width=3cm] % column 1 \setupTABLE[c][3][width=2.75cm] % column 3 \setupTABLE[c][4][width=7cm] \bTABLE \bTR \bTD Name \eTD \bTD Location \eTD \bTD Date \eTD \bTD Signature \eTD \eTR \bTR \bTD\strut \eTD \bTD \eTD \bTD \eTD \bTD \eTD \eTR \eTABLE \stoptext Mojca
participants (3)
-
Mojca Miklavec
-
Sebastian Rooks
-
The Wizard