aboutsummaryrefslogtreecommitdiff
path: root/test/tables.typst
blob: 9bdcc13b8966f9fb3e7964d2147c8444233853f2 (plain)
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
Simple table with caption:

#figure(
  align(center)[#table(
    columns: 4,
    align: (right,left,center,auto,),
    table.header([Right], [Left], [Center], [Default],),
    table.hline(),
    [12], [12], [12], [12],
    [123], [123], [123], [123],
    [1], [1], [1], [1],
  )]
  , caption: [Demonstration of simple table syntax.]
  , kind: table
  )

Simple table without caption:

#figure(
  align(center)[#table(
    columns: 4,
    align: (right,left,center,auto,),
    table.header([Right], [Left], [Center], [Default],),
    table.hline(),
    [12], [12], [12], [12],
    [123], [123], [123], [123],
    [1], [1], [1], [1],
  )]
  , kind: table
  )

Simple table indented two spaces:

#figure(
  align(center)[#table(
    columns: 4,
    align: (right,left,center,auto,),
    table.header([Right], [Left], [Center], [Default],),
    table.hline(),
    [12], [12], [12], [12],
    [123], [123], [123], [123],
    [1], [1], [1], [1],
  )]
  , caption: [Demonstration of simple table syntax.]
  , kind: table
  )

Multiline table with caption:

#figure(
  align(center)[#table(
    columns: (15%, 13.75%, 16.25%, 35%),
    align: (center,left,right,left,),
    table.header([Centered Header], [Left Aligned], [Right Aligned], [Default
      aligned],),
    table.hline(),
    [First], [row], [12.0], [Example of a row that spans multiple lines.],
    [Second], [row], [5.0], [Here's another one. Note the blank line between
    rows.],
  )]
  , caption: [Here's the caption. It may span multiple lines.]
  , kind: table
  )

Multiline table without caption:

#figure(
  align(center)[#table(
    columns: (15%, 13.75%, 16.25%, 35%),
    align: (center,left,right,left,),
    table.header([Centered Header], [Left Aligned], [Right Aligned], [Default
      aligned],),
    table.hline(),
    [First], [row], [12.0], [Example of a row that spans multiple lines.],
    [Second], [row], [5.0], [Here's another one. Note the blank line between
    rows.],
  )]
  , kind: table
  )

Table without column headers:

#figure(
  align(center)[#table(
    columns: 4,
    align: (right,left,center,right,),
    [12], [12], [12], [12],
    [123], [123], [123], [123],
    [1], [1], [1], [1],
  )]
  , kind: table
  )

Multiline table without column headers:

#figure(
  align(center)[#table(
    columns: (15%, 13.75%, 16.25%, 35%),
    align: (center,left,right,auto,),
    [First], [row], [12.0], [Example of a row that spans multiple lines.],
    [Second], [row], [5.0], [Here's another one. Note the blank line between
    rows.],
  )]
  , kind: table
  )