Skip to content

Commit 2065e88

Browse files
committed
✏ Update the readme with examples of tables and exports
1 parent afc0533 commit 2065e88

File tree

1 file changed

+235
-1
lines changed

1 file changed

+235
-1
lines changed

README.md

Lines changed: 235 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,244 @@ To load this extension locally, clone the repo to your machine. Visit the Chrome
3030
<!-- USAGE EXAMPLES -->
3131
## Usage
3232

33-
Navigate to a page that has an HTML table element (for example, [this Wikipedia page](https://en.wikipedia.org/wiki/Scholastic_accolades)). Right click on the table you would like to export and inspect it in your DevTools. **Make sure that the `<table>` element itself is selected!**
33+
Navigate to a page that has an HTML table element. Right click on the table you would like to export and inspect it in your DevTools. **Make sure that the `<table>` element itself is selected!**
3434

3535
Open the Table to Markdown panel of the DevTools (you may need to click the dropdown to see it). Click the `Convert to Markdown` button, and your markdown table will appear in the box.
3636

37+
### HTML Table export format
38+
39+
To see an example of how a table will be rendered, let's look at the following table taken from the [Scholastic Accolades Wikipedia page](https://en.wikipedia.org/wiki/Scholastic_accolades#Doctors_in_law).
40+
41+
<br />
42+
<table class="wikitable sortable jquery-tablesorter">
43+
<thead>
44+
<tr>
45+
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Accolade</th>
46+
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Name</th>
47+
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Death
48+
</th>
49+
</tr>
50+
</thead>
51+
<tbody>
52+
<tr>
53+
<td><i>Doctor Aristotelis Anima</i></td>
54+
<td><a href="/w/index.php?title=Johannes_Dondus&amp;action=edit&amp;redlink=1" class="new"
55+
title="Johannes Dondus (page does not exist)">Johannes Dondus</a></td>
56+
<td>1380
57+
</td>
58+
</tr>
59+
<tr>
60+
<td><i>Doctor a Doctoribus</i></td>
61+
<td><a href="/w/index.php?title=Antonius_Franciscus&amp;action=edit&amp;redlink=1" class="new"
62+
title="Antonius Franciscus (page does not exist)">Antonius Franciscus</a></td>
63+
<td>1528
64+
</td>
65+
</tr>
66+
<tr>
67+
<td><i>Doctor Fons Canonum</i></td>
68+
<td><a href="/w/index.php?title=Johannes_Andrea&amp;action=edit&amp;redlink=1" class="new"
69+
title="Johannes Andrea (page does not exist)">Johannes Andrea</a></td>
70+
<td>1348
71+
</td>
72+
</tr>
73+
<tr>
74+
<td><i>Doctor Fons Juris Utriusque</i></td>
75+
<td><a href="/wiki/Henry_of_Susa" class="mw-redirect" title="Henry of Susa">Henry of Susa</a> (Ostia)</td>
76+
<td>1267-81
77+
</td>
78+
</tr>
79+
<tr>
80+
<td><i>Doctor Lucerna Juris</i></td>
81+
<td><a href="/wiki/Baldus_de_Ubaldis" title="Baldus de Ubaldis">Baldus de Ubaldis</a></td>
82+
<td>1400
83+
</td>
84+
</tr>
85+
<tr>
86+
<td><i>Doctor Lucerna Juris Pontificii</i></td>
87+
<td><a href="/wiki/Nicholas_Tedeschi" class="mw-redirect" title="Nicholas Tedeschi">Nicholas Tedeschi</a> (O.S.B.)
88+
</td>
89+
<td>1445
90+
</td>
91+
</tr>
92+
<tr>
93+
<td><i>Doctor Lumen Juris</i></td>
94+
<td><a href="/wiki/Pope_Clement_IV" title="Pope Clement IV">Pope Clement IV</a></td>
95+
<td>1268
96+
</td>
97+
</tr>
98+
<tr>
99+
<td><i>Doctor Lumen Legum</i></td>
100+
<td><a href="/wiki/Irnerius" title="Irnerius">Irnerius</a></td>
101+
<td>1125 (after)
102+
</td>
103+
</tr>
104+
<tr>
105+
<td><i>Doctor Memoriosissimus</i></td>
106+
<td><a href="/w/index.php?title=Ludovicus_Pontanus&amp;action=edit&amp;redlink=1" class="new"
107+
title="Ludovicus Pontanus (page does not exist)">Ludovicus Pontanus</a></td>
108+
<td>1439
109+
</td>
110+
</tr>
111+
<tr>
112+
<td><i>Doctor Monarcha Juris</i></td>
113+
<td><a href="/w/index.php?title=Bartholomew_of_Saliceto&amp;action=edit&amp;redlink=1" class="new"
114+
title="Bartholomew of Saliceto (page does not exist)">Bartholomew of Saliceto</a></td>
115+
<td>1412
116+
</td>
117+
</tr>
118+
<tr>
119+
<td><i>Doctor Os Aureum</i></td>
120+
<td><a href="/wiki/Bulgarus" title="Bulgarus">Bulgarus</a></td>
121+
<td>1166
122+
</td>
123+
</tr>
124+
<tr>
125+
<td><i>Doctor Pater Decretalium</i></td>
126+
<td><a href="/wiki/Gregory_IX" class="mw-redirect" title="Gregory IX">Gregory IX</a></td>
127+
<td>1241
128+
</td>
129+
</tr>
130+
<tr>
131+
<td><i>Doctor Pater et Organum Veritatis</i></td>
132+
<td><a href="/wiki/Pope_Innocent_IV" title="Pope Innocent IV">Pope Innocent IV</a></td>
133+
<td>1254
134+
</td>
135+
</tr>
136+
<tr>
137+
<td><i>Doctor Pater Juris</i></td>
138+
<td><a href="/wiki/Pope_Innocent_III" title="Pope Innocent III">Pope Innocent III</a></td>
139+
<td>1216
140+
</td>
141+
</tr>
142+
<tr>
143+
<td><i>Doctor Pater Peritorum</i></td>
144+
<td><a href="/w/index.php?title=Pierre_de_Belleperche&amp;action=edit&amp;redlink=1" class="new"
145+
title="Pierre de Belleperche (page does not exist)">Pierre de Belleperche</a></td>
146+
<td>1307
147+
</td>
148+
</tr>
149+
<tr>
150+
<td><i>Doctor Planus ac Perspicuus</i></td>
151+
<td><a href="/wiki/Walter_Burley" title="Walter Burley">Walter Burleigh</a></td>
152+
<td>1337
153+
</td>
154+
</tr>
155+
<tr>
156+
<td><i>Doctor Princeps Subtilitatum</i></td>
157+
<td><a href="/w/index.php?title=Francesco_d%27Accolti&amp;action=edit&amp;redlink=1" class="new"
158+
title="Francesco d'Accolti (page does not exist)">Francesco d'Accolti</a></td>
159+
<td>1486
160+
</td>
161+
</tr>
162+
<tr>
163+
<td><i>Doctor Speculator</i></td>
164+
<td><a href="/wiki/William_Durandus" class="mw-redirect" title="William Durandus">William Durandus</a></td>
165+
<td>1296
166+
</td>
167+
</tr>
168+
<tr>
169+
<td><i>Doctor Speculum Juris</i></td>
170+
<td><a href="/wiki/Bartholus_of_Sassoferrato" class="mw-redirect" title="Bartholus of Sassoferrato">Bartholus of
171+
Sassoferrato</a></td>
172+
<td>1359
173+
</td>
174+
</tr>
175+
<tr>
176+
<td><i>Doctor Subtilis</i></td>
177+
<td><a href="/w/index.php?title=Benedict_Raymond&amp;action=edit&amp;redlink=1" class="new"
178+
title="Benedict Raymond (page does not exist)">Benedict Raymond</a></td>
179+
<td>1440
180+
</td>
181+
</tr>
182+
<tr>
183+
<td><i>Doctor Subtilis</i></td>
184+
<td>Filippo Corneo</td>
185+
<td>1462
186+
</td>
187+
</tr>
188+
<tr>
189+
<td><i>Doctor Verus</i></td>
190+
<td><a href="/w/index.php?title=Thomas_Doctius&amp;action=edit&amp;redlink=1" class="new"
191+
title="Thomas Doctius (page does not exist)">Thomas Doctius</a>, Siena</td>
192+
<td>1441
193+
</td>
194+
</tr>
195+
</tbody>
196+
<tfoot></tfoot>
197+
</table>
198+
<br />
199+
200+
This table will be rendered in Markdown as follows:
201+
202+
```
203+
| Accolade | Name | Death |
204+
|-----------------------------------|----------------------------|--------------|
205+
| Doctor Aristotelis Anima | Johannes Dondus | 1380 |
206+
| Doctor a Doctoribus | Antonius Franciscus | 1528 |
207+
| Doctor Fons Canonum | Johannes Andrea | 1348 |
208+
| Doctor Fons Juris Utriusque | Henry of Susa (Ostia) | 1267-81 |
209+
| Doctor Lucerna Juris | Baldus de Ubaldis | 1400 |
210+
| Doctor Lucerna Juris Pontificii | Nicholas Tedeschi (O.S.B.) | 1445 |
211+
| Doctor Lumen Juris | Pope Clement IV | 1268 |
212+
| Doctor Lumen Legum | Irnerius | 1125 (after) |
213+
| Doctor Memoriosissimus | Ludovicus Pontanus | 1439 |
214+
| Doctor Monarcha Juris | Bartholomew of Saliceto | 1412 |
215+
| Doctor Os Aureum | Bulgarus | 1166 |
216+
| Doctor Pater Decretalium | Gregory IX | 1241 |
217+
| Doctor Pater et Organum Veritatis | Pope Innocent IV | 1254 |
218+
| Doctor Pater Juris | Pope Innocent III | 1216 |
219+
| Doctor Pater Peritorum | Pierre de Belleperche | 1307 |
220+
| Doctor Planus ac Perspicuus | Walter Burleigh | 1337 |
221+
| Doctor Princeps Subtilitatum | Francesco d'Accolti | 1486 |
222+
| Doctor Speculator | William Durandus | 1296 |
223+
| Doctor Speculum Juris | Bartholus of Sassoferrato | 1359 |
224+
| Doctor Subtilis | Benedict Raymond | 1440 |
225+
| Doctor Subtilis | Filippo Corneo | 1462 |
226+
| Doctor Verus | Thomas Doctius, Siena | 1441 |
227+
```
228+
229+
### HTML Tables without headers
230+
Most Markdown table parsers do not support header-less tables. To compensate for this, this extension throws in a blank header row. For example, take the following table (taken from the [NBA Most Valuable Player Award Wikipedia page](https://en.wikipedia.org/wiki/NBA_Most_Valuable_Player_Award)).
231+
232+
<br/>
233+
<table class="wikitable">
234+
<tbody>
235+
<tr>
236+
<td style="background-color:#CFECEC; border:1px solid #aaaaaa; width:6em; color: #535056;">^</td>
237+
<td>Denotes player who is still active in the NBA</td>
238+
</tr>
239+
<tr>
240+
<td style="background-color:#FFFF99; border:1px solid #aaaaaa; width:6em; color: #535056;">*</td>
241+
<td>Inducted into the <a href="/wiki/Naismith_Memorial_Basketball_Hall_of_Fame" title="Naismith Memorial Basketball Hall of Fame">Naismith Memorial Basketball Hall of Fame</a></td>
242+
</tr>
243+
<tr>
244+
<td style="background-color:#FFE6BD; border:1px solid #aaaaaa; width:6em; color: #535056;">†</td>
245+
<td>Denotes player whose team won championship that year</td>
246+
</tr>
247+
<tr>
248+
<td>Player (X)</td>
249+
<td>Denotes the number of times the player had been named MVP at that time</td>
250+
</tr>
251+
<tr>
252+
<td>Team (X)</td>
253+
<td>Denotes the number of times a player from this team had won at that time</td>
254+
</tr>
255+
</tbody>
256+
</table>
257+
<br/>
258+
259+
This table will be rendered in Markdown like this:
260+
261+
```
262+
| | |
263+
|------------|--------------------------------------------------------------------------|
264+
| ^ | Denotes player who is still active in the NBA |
265+
| * | Inducted into the Naismith Memorial Basketball Hall of Fame |
266+
| † | Denotes player whose team won championship that year |
267+
| Player (X) | Denotes the number of times the player had been named MVP at that time |
268+
| Team (X) | Denotes the number of times a player from this team had won at that time |
269+
```
270+
37271
<!-- CONTRIBUTING -->
38272
## Contributing
39273

0 commit comments

Comments
 (0)