[NTG-context] Color a column (xtable, lua)

Fabrice Couvreur fabrice1.couvreur at gmail.com
Sun Jan 27 00:08:41 CET 2019


Hi,
How to color the first column as I did for the first line ?
Thank you
Fabrice

\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
\starttext
\startluacode
local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" }
local letters_2 = { "A", "0", "1", "1", "0", "", "", "", "", "" }
context.startxtable({"align={middle,lohi}, width=1.25cm,offset=0.8ex"})
context.startxrow()
context.startxcell({"background=color,backgroundcolor=white,frame=off"})
context("") context.stopxcell()
for _, letter in ipairs(letters_1) do
     context.startxcell({"background=color,backgroundcolor=fondpaille"})
context(letter) context.stopxcell()
end
context.stopxrow()
context.startxrow()
for _, letter in ipairs(letters_2) do
     context.startxcell() context(letter) context.stopxcell()
end
context.stopxrow()
for i=2,10 do
     context.startxrow()
     context.startxcell()  context(converters.convert("A",i))
context.stopxcell()
     context.stopxrow()
end
context.stopxtable()
\stopluacode
\stoptext
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20190127/7130ec91/attachment.html>


More information about the ntg-context mailing list