1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
// Test tables.
---
#set page(height: 70pt)
#set table(fill: (x, y) => if calc.even(x + y) { rgb("aaa") })
#table(
columns: (1fr,) * 3,
stroke: 2pt + rgb("333"),
[A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H],
)
---
#table(columns: 3, stroke: none, fill: green, [A], [B], [C])
---
// Test alignment with array.
#table(
columns: (1fr, 1fr, 1fr),
align: (left, center, right),
[A], [B], [C]
)
// Test empty array.
#set align(center)
#table(
columns: (1fr, 1fr, 1fr),
align: (),
[A], [B], [C]
)
---
// Test inset.
#table(
columns: 3,
inset: 10pt,
[A], [B], [C]
)
#table(
columns: 3,
inset: (y: 10pt),
[A], [B], [C]
)
#table(
columns: 3,
inset: (left: 20pt, rest: 10pt),
[A], [B], [C]
)
#table(
columns: 2,
inset: (
left: 20pt,
right: 5pt,
top: 10pt,
bottom: 3pt,
),
[A],
[B],
)
#table(
columns: 3,
fill: (x, y) => (if y == 0 { aqua } else { orange }).darken(x * 15%),
inset: (x, y) => (left: if x == 0 { 0pt } else { 5pt }, right: if x == 0 { 5pt } else { 0pt }, y: if y == 0 { 0pt } else { 5pt }),
[A], [B], [C],
[A], [B], [C],
)
#table(
columns: 3,
inset: (0pt, 5pt, 10pt),
fill: (x, _) => aqua.darken(x * 15%),
[A], [B], [C],
)
---
// Test inset folding
#set table(inset: 10pt)
#set table(inset: (left: 0pt))
#table(
fill: red,
inset: (right: 0pt),
table.cell(inset: (top: 0pt))[a]
)
---
// Test interaction with gutters.
#table(
columns: (3em, 3em),
fill: (x, y) => (red, blue).at(calc.rem(x, 2)),
align: (x, y) => (left, right).at(calc.rem(y, 2)),
[A], [B],
[C], [D],
[E], [F],
[G], [H]
)
#table(
columns: (3em, 3em),
fill: (x, y) => (red, blue).at(calc.rem(x, 2)),
align: (x, y) => (left, right).at(calc.rem(y, 2)),
row-gutter: 5pt,
[A], [B],
[C], [D],
[E], [F],
[G], [H]
)
#table(
columns: (3em, 3em),
fill: (x, y) => (red, blue).at(calc.rem(x, 2)),
align: (x, y) => (left, right).at(calc.rem(y, 2)),
column-gutter: 5pt,
[A], [B],
[C], [D],
[E], [F],
[G], [H]
)
#table(
columns: (3em, 3em),
fill: (x, y) => (red, blue).at(calc.rem(x, 2)),
align: (x, y) => (left, right).at(calc.rem(y, 2)),
gutter: 5pt,
[A], [B],
[C], [D],
[E], [F],
[G], [H]
)
---
// Ref: false
#table()
---
// Error: 14-19 expected color, gradient, pattern, none, array, or function, found string
#table(fill: "hey")
|