Add table pretty printing & alignment
Also dismissed implementing colgroups for now - had it but didn't like the added complexity for a very questionable benefit - i've actually never used that feature of org tables...
This commit is contained in:
parent
c08119bbc8
commit
f28f400d7e
10 changed files with 261 additions and 113 deletions
9
org/testdata/footnotes.html
vendored
9
org/testdata/footnotes.html
vendored
|
@ -53,13 +53,16 @@ and tables
|
|||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td><td>a</td>
|
||||
<td class="align-right">1</td>
|
||||
<td>a</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td><td>b</td>
|
||||
<td class="align-right">2</td>
|
||||
<td>b</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td><td>c</td>
|
||||
<td class="align-right">3</td>
|
||||
<td>c</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
10
org/testdata/lists.html
vendored
10
org/testdata/lists.html
vendored
|
@ -60,11 +60,17 @@ and another one with a table
|
|||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<th>a</th><th>b</th><th>c</th>
|
||||
<tr>
|
||||
<th class="align-right">a</th>
|
||||
<th class="align-right">b</th>
|
||||
<th class="align-right">c</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td><td>2</td><td>3</td>
|
||||
<td class="align-right">1</td>
|
||||
<td class="align-right">2</td>
|
||||
<td class="align-right">3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
6
org/testdata/misc.html
vendored
6
org/testdata/misc.html
vendored
|
@ -20,10 +20,12 @@ crazy ain't it?
|
|||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>foo</strong></td><td>foo</td>
|
||||
<td><strong>foo</strong></td>
|
||||
<td>foo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>bar</strong></td><td>bar</td>
|
||||
<td><strong>bar</strong></td>
|
||||
<td>bar</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
76
org/testdata/tables.html
vendored
76
org/testdata/tables.html
vendored
|
@ -1,11 +1,17 @@
|
|||
<figure>
|
||||
<table>
|
||||
<thead>
|
||||
<th>a</th><th>b</th><th>c</th>
|
||||
<tr>
|
||||
<th class="align-right">a</th>
|
||||
<th class="align-right">b</th>
|
||||
<th class="align-right">c</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td><td>2</td><td>3</td>
|
||||
<td class="align-right">1</td>
|
||||
<td class="align-right">2</td>
|
||||
<td class="align-right">3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -16,11 +22,17 @@ table with separator before and after header
|
|||
<figure>
|
||||
<table>
|
||||
<thead>
|
||||
<th>a</th><th>b</th><th>c</th>
|
||||
<tr>
|
||||
<th class="align-right">a</th>
|
||||
<th class="align-right">b</th>
|
||||
<th class="align-right">c</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td><td>2</td><td>3</td>
|
||||
<td class="align-right">1</td>
|
||||
<td class="align-right">2</td>
|
||||
<td class="align-right">3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -31,9 +43,10 @@ table with separator after header
|
|||
<figure>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr></tr>
|
||||
<tr>
|
||||
<td>1</td><td>2</td><td>3</td>
|
||||
<td class="align-right">1</td>
|
||||
<td class="align-right">2</td>
|
||||
<td class="align-right">3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -45,7 +58,9 @@ table without header (but separator before)
|
|||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td><td>2</td><td>3</td>
|
||||
<td class="align-right">1</td>
|
||||
<td class="align-right">2</td>
|
||||
<td class="align-right">3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -53,3 +68,50 @@ table without header (but separator before)
|
|||
table without header
|
||||
</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="align-left">left aligned</th>
|
||||
<th class="align-right">right aligned</th>
|
||||
<th class="align-center">center aligned</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="align-left">42</td>
|
||||
<td class="align-right">42</td>
|
||||
<td class="align-center">42</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="align-left">foobar</td>
|
||||
<td class="align-right">foobar</td>
|
||||
<td class="align-center">foobar</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<figcaption>
|
||||
table with aligned columns
|
||||
</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="align-right">long column a</th>
|
||||
<th class="align-right">long column b</th>
|
||||
<th class="align-right">long column c</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="align-right">1</td>
|
||||
<td class="align-right">2</td>
|
||||
<td class="align-right">3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<figcaption>
|
||||
table with right aligned columns (because numbers)
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
|
11
org/testdata/tables.org
vendored
11
org/testdata/tables.org
vendored
|
@ -16,3 +16,14 @@
|
|||
#+CAPTION: table without header
|
||||
| 1 | 2 | 3 |
|
||||
|
||||
#+CAPTION: table with aligned columns
|
||||
| left aligned | right aligned | center aligned |
|
||||
|--------------+---------------+----------------|
|
||||
| <l> | <r> | <c> |
|
||||
| 42 | 42 | 42 |
|
||||
| foobar | foobar | foobar |
|
||||
|
||||
#+CAPTION: table with right aligned columns (because numbers)
|
||||
| long column a | long column b | long column c |
|
||||
|---------------+---------------+---------------|
|
||||
| 1 | 2 | 3 |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue