-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_grid_tables.qmd
More file actions
131 lines (100 loc) · 5.11 KB
/
example_grid_tables.qmd
File metadata and controls
131 lines (100 loc) · 5.11 KB
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
---
format: texnative-pdf
filters:
- texnative
toc: false # show table of contents
page_numbers: true # show page numbers
paragraph_numbers: false # show paragraph numbers before headers
papersize: a4 # page size
letterhead: false # use a letterhead background
disable_justify: true # true: justify left and right, false: only justify left;
---
# Grid Tables Examples
Examples taken from: https://pandoc.org/demo/example33/8.9-tables.html but with extra Quarto features.
Grid tables look like this:
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | €1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | €2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
: Table width bullet lists
+---------------+---------------+---------------------+
| Fruit | Price | Advantages |
+===============+===============+=====================+
| Bananas | €1.34 | built-in wrapper |
| | | |
| Bananas | | built-in wrapper |
+---------------+---------------+---------------------+
| Oranges | €2.10 | This |
| | | cell contains text |
| | | which should be |
| | | wrapped over |
| | | multiple lines |
| | | |
| | | tasty table cells. |
+---------------+---------------+---------------------+
: Table width hard line breaks
The row of =s separates the header from the table body, and can be omitted for a headerless table. The cells of grid tables may contain arbitrary block elements (multiple paragraphs, code blocks, lists, etc.).
<!--
Cells can span multiple columns or rows:
+------------------------+------------------+
| Property | Earth |
+========================+=======+==========+
| | min | -89.2 °C |
| Temperature +-------+----------+
| 1961-1990 | mean | 14 °C |
| +-------+----------+
| | max | 56.7 °C |
+------------------------+-------+----------+
: Table width cell spanning over multiple rows
A table header may contain more than one row:
+---------------------+-----------------------+
| Location | Temperature 1961-1990 |
| | in degree Celsius |
| +-------+-------+-------+
| | min | mean | max |
+=====================+=======+=======+=======+
| Antarctica | -89.2 | N/A | 19.8 |
+---------------------+-------+-------+-------+
| Earth | -89.2 | 14 | 56.7 |
+---------------------+-------+-------+-------+
: Table width header with multiple rows
-->
Alignments can be specified as with pipe tables, by putting colons at the boundaries of the separator line after the header:
+---------------+---------------+--------------------+
| Right | Left | Centered |
+==============:+:==============+:==================:+
| Bananas | €1.34 | built-in wrapper |
+---------------+---------------+--------------------+
For headerless tables, the colons go on the top line instead:
+--------------:+:--------------+:------------------:+
| Right | Left | Centered |
+---------------+---------------+--------------------+
A table foot can be defined by enclosing it with separator lines that use = instead of -:
Grid tables look can also have extra style configurations
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | €1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | €2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
: Custom styling {tbl-body-bgcolor="80,50,20" tbl-body-txtcolor="255,255,255" tbl-header-bgcolor="250,0,0" tbl-border-color="250,0,0" tbl-border-width="2"}
<!--
+---------------+---------------+
| Fruit | Price |
+===============+===============+
| Bananas | €1.34 |
+---------------+---------------+
| Oranges | €2.10 |
+===============+===============+
| Sum | €3.44 |
+===============+===============+
The foot must always be placed at the very bottom of the table.
-->