TABLE: header with a thick bottom line
![](https://secure.gravatar.com/avatar/d6e7462bd4209f9c4cd08271985a50df.jpg?s=120&d=mm&r=g)
Hello, how to achieve the table header to have a thick bottom line? Here are my two attempts: ---- \starttext \bTABLE \setupTABLE[width=broad] \setupTABLE[header][align=middle] \bTABLEhead \bTR[bottomframe=on,rulethickness=2mm]\bTH a\eTH\bTH b\eTH\eTR \eTABLEhead \bTABLEbody \bTR\bTD 1\eTD\bTD 2\eTD\eTR \bTR\bTD 3\eTD\bTD 4\eTD\eTR \eTABLEbody \eTABLE Or even better: \bTABLE \setupTABLE[width=broad] \setupTABLE[header][bottomframe=on,rulethickness=2mm,align=middle] \bTABLEhead \bTR\bTH a\eTH\bTH b\eTH\eTR \eTABLEhead \bTABLEbody \bTR\bTD 1\eTD\bTD 2\eTD\eTR \bTR\bTD 3\eTD\bTD 4\eTD\eTR \eTABLEbody \eTABLE \stoptext ---- As you can see, in both cases all header cells are surrounded by a thick border; but only the bottom border should be. How to achieve it? TIA. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Mon, 22 Oct 2012, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
how to achieve the table header to have a thick bottom line?
Here are my two attempts:
---- \starttext \bTABLE \setupTABLE[width=broad] \setupTABLE[header][align=middle] \bTABLEhead \bTR[bottomframe=on,rulethickness=2mm]\bTH a\eTH\bTH b\eTH\eTR \eTABLEhead \bTABLEbody \bTR\bTD 1\eTD\bTD 2\eTD\eTR \bTR\bTD 3\eTD\bTD 4\eTD\eTR \eTABLEbody \eTABLE
Or even better:
\bTABLE \setupTABLE[width=broad] \setupTABLE[header][bottomframe=on,rulethickness=2mm,align=middle] \bTABLEhead \bTR\bTH a\eTH\bTH b\eTH\eTR \eTABLEhead \bTABLEbody \bTR\bTD 1\eTD\bTD 2\eTD\eTR \bTR\bTD 3\eTD\bTD 4\eTD\eTR \eTABLEbody \eTABLE \stoptext ----
As you can see, in both cases all header cells are surrounded by a thick border; but only the bottom border should be.
If you want only the bottom border (and no other border), use ....[frame=off, bottomframe=on, ...]
How to achieve it?
If you want to have all borders, but only draw the bottom border with a different thickness, you will have to use a custom metapost background. Aditya
![](https://secure.gravatar.com/avatar/d6e7462bd4209f9c4cd08271985a50df.jpg?s=120&d=mm&r=g)
On Mon, 22 Oct 2012 16:41:46 +0200, Aditya Mahajan
If you want only the bottom border (and no other border),
... No, I want all borders with default thickness but head bottom border thicker; this is most common look of my tables: +---+---+ | a | b | -> header +===+===+ | 1 | 2 | \ +---+---+ > body | 3 | 4 | / +---+---+
use
....[frame=off, bottomframe=on, ...]
How to achieve it?
If you want to have all borders, but only draw the bottom border with a different thickness, you will have to use a custom metapost background.
... OK. I believed there would be something like \setupTABLE[header][bottomframe=on,bottomrulethickness=2pt] Lukas
Aditya
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
![](https://secure.gravatar.com/avatar/d39338246f50cca667c8256c313d7cfd.jpg?s=120&d=mm&r=g)
2012-10-22 Procházka Lukáš Ing. - Pontex s. r. o.:
On Mon, 22 Oct 2012 16:41:46 +0200, Aditya Mahajan
wrote: If you want only the bottom border (and no other border),
... No, I want all borders with default thickness but head bottom border thicker; this is most common look of my tables:
http://wiki.contextgarden.net/TABLE#Rules_with_different_thickness Marco
![](https://secure.gravatar.com/avatar/d6e7462bd4209f9c4cd08271985a50df.jpg?s=120&d=mm&r=g)
On Mon, 22 Oct 2012 17:45:21 +0200, Marco Patzer
http://wiki.contextgarden.net/TABLE#Rules_with_different_thickness
... I knew this snippet; unfortunately, there were some bindings or relationships that I didn't understand fully.
Marco
Anyway, after some experiments, based on Wolfgang's code on wiki, I reached the following minimal working example: ---- \startuseMPgraphic{MP:thickBtm} draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness}; clip currentpicture to OverlayBox; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}] \starttext \bTABLE \setupTABLE[align=middle] \setupTABLE[header][background={OL:thickBtm},bottomrulethickness=3mm] \setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=1.5mm] % \bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead \bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}\eTABLEbody \eTABLE \stoptext ---- Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
![](https://secure.gravatar.com/avatar/fb484099da4fdb6a62c12cb083d6659a.jpg?s=120&d=mm&r=g)
One issue is that the overlay overlaps the text space (reduces whitespace or potentially overlaps letters). One could use a blank row with a black background, but a row seems to have a minimum height of about 2mm. I discovered the "boffset" key, which can be used with the overlay, but it's kludgy. Perhaps there is a better way... Michael \startuseMPgraphic{MP:thickBtm} draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness}; clip currentpicture to OverlayBox; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}] \starttext \bTABLE % Overlay method \setupTABLE[align=middle] % By eye, by trial: boffset = bottomrulethickness/2 - 0.2mm \setupTABLE[header][background={OL:thickBtm},bottomrulethickness=3mm,boffset=1.3mm] \setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=1.5mm, boffset=.55mm] % \bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead \bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}\eTABLEbody \eTABLE \stoptext ________________________________ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments).
participants (4)
-
Aditya Mahajan
-
Marco Patzer
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Rogers, Michael K