Skip to content

Table stroke renders incorrectly #5320

@oMatheuss

Description

@oMatheuss

Description

Code:

#set page(
  width: auto,
  height: 5cm,
)

#table(
  columns: 3,
  stroke: (x, y) => (
    right: .5pt,
    left: if x == 0 or y > 0 { .5pt } else { 0pt },
    bottom: .5pt,
    top: if y <= 1 { .5pt } else { (paint: black, thickness: 2pt, dash: "dotted") },
  ),
  table.header([A],[B],[C]),
  [1],[2],[3],
  [4],[5],[6],
  [7],[8],[9],
  [1],[2],[3],
  [4],[5],[6],
  [7],[8],[9],
  [1],[2],[3],
  [4],[5],[6],
  [7],[8],[9],
  [1],[2],[3],
)

In the code above the dash style for the line below the header is incorrectly draw for pages after the first. I dont know if this is intended behaviour, but I think that it should be nice if it could render as I expected (page breakes clone the style from the first).

The main reason I think this is a bug is that the thickness is still 0.5pt, but other properties change (paint, dash). But logically speaking it would make more sense if the thickness respected 2pt.

And if anyone has an workaround for this I would be grateful.

Reproduction URL

No response

Operating system

Web app, Windows

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions