# formatting natural table header with conTeXt

I am struggling with my table formatting a bit and hope there is someone around here that can give me some help.

This is the table I have at the moment.

\bTABLE
\bTR \bTD No. \eTD \bTD[nc=2] Length              \eTD \eTR
\bTR \bTD               \bTD [m] \eTD \bTD [inch] \eTD \eTR
\startTABLEbody
\bTR \bTD 1.  \eTD \bTD 1        \eTD \bTD 25.4   \eTD \eTR
\stopTABLEbody
\eTABLE


now I want a rule on top of the first row and on the bottom of the second row. That's simple enough only I would like to do this by using something like this

\setupTABLE[frame=off]


This way I can use this setup on all the tables in my document.

Can this be done?

-

\setupTABLE{header] does not accept first or last keys. You can only use \setupTABLE[header][1] etc, but that sets the style for the 1st column of the header. Currently, there is no way to set the style of the rows of the table header.

However, it is easy to define your own Metapost background that adds topframe and bottomframe to the table header and works with multipage tables.

\setupTABLE[frame=off]

if \positiverow = 1 : % first row
draw topboundary OverlayBox
elseif \positiverow = \noftblheadlines : % last row
draw bottomboundary OverlayBox
fi
withcolor OverlayLineColor
withpen pensquare scaled OverlayLineWidth;

setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\starttext
\bTABLE[split=repeat]