-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9384 from ckeditor/i/9085-table-caption-docs
Docs (table): Added caption documentation and demo. Closes #9085.
- Loading branch information
Showing
5 changed files
with
157 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
packages/ckeditor5-table/docs/_snippets/features/table-caption.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<div id="snippet-table-caption"> | ||
<figure class="table"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Mass (10<sup>24</sup>kg)</th> | ||
<th>Diameter (km)</th> | ||
<th>Gravity (m/s<sup>2</sup>)</th> | ||
<th>Length of day (hours)</th> | ||
<th>Distance from Sun (10<sup>6</sup>km)</th> | ||
<th>Mean temperature (°C)</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th>Mercury</th> | ||
<td>0.330</td> | ||
<td>4,879</td> | ||
<td>3.7</td> | ||
<td>4222.6</td> | ||
<td>57.9</td> | ||
<td>167</td> | ||
</tr> | ||
<tr> | ||
<th>Venus</th> | ||
<td>4.87</td> | ||
<td>12,104</td> | ||
<td>8.9</td> | ||
<td>2802.0</td> | ||
<td>108.2</td> | ||
<td>464</td> | ||
</tr> | ||
<tr> | ||
<th>Earth</th> | ||
<td>5.97</td> | ||
<td>12,756</td> | ||
<td>9.8</td> | ||
<td>24.0</td> | ||
<td>149.6</td> | ||
<td>15</td> | ||
</tr> | ||
<tr> | ||
<th>Mars</th> | ||
<td>0.642</td> | ||
<td>6,792</td> | ||
<td>3.7</td> | ||
<td>24.7</td> | ||
<td>227.9</td> | ||
<td>-65</td> | ||
</tr> | ||
<tr> | ||
<th>Jupiter</th> | ||
<td>1898</td> | ||
<td>142,984</td> | ||
<td>23.1</td> | ||
<td>9.9</td> | ||
<td>778.6</td> | ||
<td>-110</td> | ||
</tr> | ||
<tr> | ||
<th>Saturn</th> | ||
<td>568</td> | ||
<td>120,536</td> | ||
<td>9.0</td> | ||
<td>10.7</td> | ||
<td>1433.5</td> | ||
<td>-140</td> | ||
</tr> | ||
<tr> | ||
<th>Uranus</th> | ||
<td>86.8</td> | ||
<td>51,118</td> | ||
<td>8.7</td> | ||
<td>17.2</td> | ||
<td>2872.5</td> | ||
<td>-195</td> | ||
</tr> | ||
<tr> | ||
<th>Neptune</th> | ||
<td>102</td> | ||
<td>49,528</td> | ||
<td>11.0</td> | ||
<td>16.1</td> | ||
<td>4495.1</td> | ||
<td>-200</td> | ||
</tr> | ||
<tr> | ||
<th>Pluto</th> | ||
<td>0.0146</td> | ||
<td>2,370</td> | ||
<td>0.7</td> | ||
<td>153.3</td> | ||
<td>5906.4</td> | ||
<td>-225</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<figcaption> | ||
Data about the planets of our solar system (Planetary facts taken from | ||
<a href="http://nssdc.gsfc.nasa.gov/planetary/factsheet/">Nasa's Planetary Fact Sheet - Metric</a>). | ||
</figcaption> | ||
</figure> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
packages/ckeditor5-table/docs/_snippets/features/table-caption.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals ClassicEditor, CKEditorPlugins, console, window, document */ | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#snippet-table-caption' ), { | ||
extraPlugins: [ | ||
CKEditorPlugins.TableCaption, CKEditorPlugins.Superscript | ||
], | ||
table: { | ||
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'toggleTableCaption' ] | ||
}, | ||
image: { | ||
toolbar: [ | ||
'imageStyle:full', | ||
'imageStyle:side', | ||
'|', | ||
'imageTextAlternative' | ||
] | ||
} | ||
} ) | ||
.then( editor => { | ||
window.editorCaption = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters