Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update rounded-corner-table.md #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/FAQ/rounded-corner-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ tags: [table]

# 如何实现圆角表格?

使用 block 提供的 radius 即可实现圆角,结合 clip 参数可以去除不需要的部分。为了实现样式的统一 stroke 需要提前定义。
使用 `block` 提供的 `radius` 即可实现圆角,结合 `clip` 参数可以去除不需要的部分。为了实现样式的统一 `stroke` 需要提前定义。

```typst
#set page(width: 10cm, height: auto)
#let stroke = stroke(2pt + gradient.linear(..color.map.plasma))
#show table: it => block(stroke: stroke, radius: 4em, clip: true, it)
#show table: it => block(stroke: stroke, radius: 2em, clip: true, it)

#table(
columns: (4em,) * 5,
rows: (4em,),
columns: (1fr,) * 5,
rows: 3em,
stroke: stroke,
align: (x, y) => {
if (calc.odd(x + y)) {
Expand Down