\newdimen\toprulethickness    \toprulethickness1pt
\newdimen\midrulethickness     \midrulethickness.4pt
\newdimen\bottomrulethickness \bottomrulethickness\toprulethickness
\newdimen\toprulesep           \toprulesep2ex
\newdimen\midrulesep           \midrulesep.5\toprulesep
\newdimen\bottomrulesep       \bottomrulesep\toprulesep
\newdimen\lefttrim             \lefttrim.25em
\newdimen\righttrim           \righttrim\lefttrim

\startuniqueMPgraphic{toprule}
  fill unitsquare xscaled \overlaywidth yscaled \MPvar{rulethickness}
    shifted (0,\overlayheight-\MPvar{rulethickness});
\stopuniqueMPgraphic
\startuniqueMPgraphic{bottomrule}
  fill unitsquare xscaled \overlaywidth yscaled \MPvar{rulethickness};
\stopuniqueMPgraphic
\startuniqueMPgraphic{midrule}
  fill unitsquare xscaled \overlaywidth yscaled \MPvar{rulethickness}
    shifted (0,.5*(\overlayheight-\MPvar{rulethickness}));
\stopuniqueMPgraphic
\startuniqueMPgraphic{cmidrule}
  fill unitsquare 
    xscaled (\overlaywidth-\MPvar{lefttrim}-\MPvar{righttrim})
    yscaled \MPvar{rulethickness}
    shifted (0,.5*(\overlayheight-\MPvar{rulethickness}));
\stopuniqueMPgraphic

\setupMPvariables[toprule][rulethickness=\the\toprulethickness]
\setupMPvariables[midrule][rulethickness=\the\midrulethickness]
\setupMPvariables[cmidrule][rulethickness=\the\midrulethickness,
  lefttrim=\the\lefttrim, righttrim=\the\righttrim]
\setupMPvariables[bottomrule][rulethickness=\the\bottomrulethickness]

\defineoverlay[toprule][\uniqueMPgraphic{toprule}]
\defineoverlay[midrule][\uniqueMPgraphic{midrule}]
\defineoverlay[cmidrule][\uniqueMPgraphic{cmidrule}]
\defineoverlay[bottomrule][\uniqueMPgraphic{bottomrule}]

\define\TRL{\bTR[height=\dimexpr(\toprulethickness+\toprulesep),
                background=toprule]\eTR}
\define\BRL{\bTR[height=\dimexpr(\bottomrulethickness+\bottomrulesep),
                background=bottomrule]\eTR}
\define\MRL{\bTR[height=\dimexpr(\midrulethickness+\midrulesep),
                background=midrule]\eTR}

\starttext

  \setupTABLE[frame=off]
  \setupTABLE[row][each][align={middle,lohi}]
  \bTABLE
    \TRL
    \bTR \bTD[nr=3] rowspan \eTD
         \bTD[nc=2] colspan \eTD
    \eTR
    \bTR[height=\midrulethickness]
      \bTD[nc=2,background=cmidrule]\eTD
    \eTR
    \bTR                        
      \bTD this is this \eTD \bTD that is that\eTD
    \eTR
    \MRL
    \bTR \bTD 1,1 \eTD \bTD 2,1 \eTD \bTD 3,1 \eTD \eTR
    \bTR \bTD 1,2 \eTD \bTD 2,2 \eTD \bTD 3,2 \eTD \eTR
    \BRL
  \eTABLE

\stoptext
