I have a table where the vertical borders of each cell are 1pt thick (..., stroke: (left: 1pt, right: 1pt), ...). For the header cells, I’d like have have a top and a bottom border that is 4pt thick (..., stroke: (top: 4pt, bottom: 4pt), ...).
This is easy to achieve, but the result is not satisfying:
As we can see, the horizontal borders in the header are too wide. It seems that their vertical thickness is added to their horizontal extent at the left and the right side (the picture only shows the left side).
Is there a way to prevent this?
What I already have tried (without success):
I have looked into the cap property of stroke and have used the value "square" instead of the default value "butt" for it. This made the situation worse; the horizontal lines became even wider.
I also have tried to use table.vline and table.hline instead of styling the cells. However, I had exactly the same problem with them.
Possibly using gutter could help here, but I didn’t try. If possible, I’d like to avoid it.
I also could imagine a possible solution that works by putting each cell’s content into a box, placing the box in the respective cell, and applying horizontal borders (top, bottom) to the box and vertical borders to the table cell. I didn’t try that, though, because it would be quite ugly.


