UNPKG

6.42 kBYAMLView Raw
1cases:
2 - title: Basic table
3 id: table
4 mdast:
5 type: root
6 children:
7 - type: table
8 children:
9 - type: tableRow
10 children:
11 - type: tableCell
12 header: true
13 align: left
14 children:
15 - type: text
16 value: header 1
17 - type: tableCell
18 header: true
19 align: right
20 children:
21 - type: text
22 value: header 2
23 - type: tableRow
24 children:
25 - type: tableCell
26 align: left
27 children:
28 - type: text
29 value: '3'
30 - type: tableCell
31 align: right
32 children:
33 - type: text
34 value: '4'
35
36 myst: |-
37 | header 1 | header 2 |
38 |:---|---:|
39 | 3 | 4 |
40 html: |-
41 <table>
42 <thead>
43 <tr>
44 <th>header 1</th>
45 <th>header 2</th>
46 </tr>
47 </thead>
48 <tbody>
49 <tr>
50 <td>3</td>
51 <td>4</td>
52 </tr>
53 </tbody>
54 </table>
55 latex: |-
56 \begin{tabular}{*{2}{c}}
57 \hline
58 header 1 & header 2 \\
59 \hline
60 3 & 4 \\
61 \hline
62 \end{tabular}
63
64 - title: Basic list table
65 mdast:
66 type: root
67 children:
68 - type: mystDirective
69 name: list-table
70 args: Caption *text*
71 options:
72 name: my-table
73 header-rows: 1
74 align: center
75 class: myclass
76 value: |-
77 * - Head 1, Column 1
78 - Head 1, Column 2
79 - Head 1, Column 3
80 * - Row 1, Column 1
81 - Row 1, Column 2
82 - Row 1, Column 3
83 * - Row 2, Column 1
84 - Row 2, Column 2
85 - Row 2, **Column 3**
86 children:
87 - type: container
88 kind: table
89 identifier: my-table
90 label: my-table
91 class: myclass
92 children:
93 - type: caption
94 children:
95 - type: paragraph
96 children:
97 - type: text
98 value: 'Caption '
99 - type: emphasis
100 children:
101 - type: text
102 value: text
103 - type: table
104 align: center
105 children:
106 - type: tableRow
107 children:
108 - type: tableCell
109 header: true
110 children:
111 - type: text
112 value: Head 1, Column 1
113 - type: tableCell
114 header: true
115 children:
116 - type: text
117 value: Head 1, Column 2
118 - type: tableCell
119 header: true
120 children:
121 - type: text
122 value: Head 1, Column 3
123 - type: tableRow
124 children:
125 - type: tableCell
126 children:
127 - type: text
128 value: Row 1, Column 1
129 - type: tableCell
130 children:
131 - type: text
132 value: Row 1, Column 2
133 - type: tableCell
134 children:
135 - type: text
136 value: Row 1, Column 3
137 - type: tableRow
138 children:
139 - type: tableCell
140 children:
141 - type: text
142 value: Row 2, Column 1
143 - type: tableCell
144 children:
145 - type: text
146 value: Row 2, Column 2
147 - type: tableCell
148 children:
149 - type: text
150 value: 'Row 2, '
151 - type: strong
152 children:
153 - type: text
154 value: Column 3
155
156 myst: |-
157 ```{list-table} Caption *text*
158 :name: my-table
159 :header-rows: 1
160 :align: center
161 :class: myclass
162
163 * - Head 1, Column 1
164 - Head 1, Column 2
165 - Head 1, Column 3
166 * - Row 1, Column 1
167 - Row 1, Column 2
168 - Row 1, Column 3
169 * - Row 2, Column 1
170 - Row 2, Column 2
171 - Row 2, **Column 3**
172 ```
173 html: |-
174 <figure id="my-table" class="numbered myclass">
175 <figcaption>
176 <p><span class="caption-number">Table 1</span>Caption <em>text</em></p>
177 </figcaption>
178 <table align="center">
179 <thead>
180 <tr>
181 <th>Head 1, Column 1</th>
182 <th>Head 1, Column 2</th>
183 <th>Head 1, Column 3</th>
184 </tr>
185 </thead>
186 <tbody>
187 <tr>
188 <td>Row 1, Column 1</td>
189 <td>Row 1, Column 2</td>
190 <td>Row 1, Column 3</td>
191 </tr>
192 <tr>
193 <td>Row 2, Column 1</td>
194 <td>Row 2, Column 2</td>
195 <td>Row 2, <strong>Column 3</strong></td>
196 </tr>
197 </tbody>
198 </table>
199 </figure>
200 latex: |-
201 \begin{table}[!htbp]
202 \centering
203 \caption*{Caption \textit{text}}
204
205 \begin{tabular}{*{3}{c}}
206 \hline
207 Head 1, Column 1 & Head 1, Column 1 & Head 3, Column 3 \\
208 \hline
209 Row 1, Column 1 & Row 1, Column 2 & Row 1, Column 3 \\
210 Row 2, Column 1 & Row 2, Column 2 & Row 2, \textbf{Column 3} \\
211 \hline
212 \end{tabular}
213 \end{table}