Replies: 3 comments
-
You could use the following solution: #set page(height: 10em, width: 25em )
#set table(stroke: (_, y) => if y == 0 { (bottom: 1pt) })
#show table: block.with(stroke: (y: 1pt))
#table(
columns: (1fr,) * 4,
table.header[Header 1][Header 2][Header 3][Header 4],
"Contents A", "Contents B", "Contents C", "Contents D",
"Contents A", "Contents B", "Contents C", "Contents D",
"Contents A", "Contents B", "Contents C", "Contents D",
"Contents A", "Contents B", "Contents C", "Contents D",
"Contents A", "Contents B", "Contents C", "Contents D",
"Contents A", "Contents B", "Contents C", "Contents D",
) I don't think this solution is totally obvious or ideal, though. |
Beta Was this translation helpful? Give feedback.
-
I was dealing with the same question. Having something like "-1" or "last" would be ideal to make it fully functional and straightforward. Solution with "block" does seem to have some limitations, I can't apply arbitrary styling with it. |
Beta Was this translation helpful? Give feedback.
-
For a single table, you can add a #table(
[a], [b],
[c], [d],
table.hline(stroke: red)
) This won't work for templates, however (unless you redefine the It is expected to have such a feature for table templates in the future. |
Beta Was this translation helpful? Give feedback.
-
Description
Is it possible to find the bottom row of a table when setting the strokes for a table.
Use Case
I am trying to create a table that has strokes in the first row, top and bottom, and at the bottom of the table. I used the guide which had a similar example setting the top stroke if y < 2 and the bottom stroke always, but this breaks if there is a page break as the header row on the second page is not proceeded by the first row so on the second page does not get its bottom border.
I have found that setting the header row to top and bottom stroke and then manually setting the bottom row to a bottom stroke but this relies on me knowing how many rows are in the table.
I have looked through the table and grid documentation and the grid documentation suggests there is a
bottom
that can be referenced to reference the bottom row but I have tried using it and, while it does not cause an error, does not result in a bottom borderI apologise if I am missing something obvious
Beta Was this translation helpful? Give feedback.
All reactions