table.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <style>
  2. table {
  3. border-collapse: collapse;
  4. border-spacing: 0;
  5. }
  6. table, th, td {
  7. padding: 5px;
  8. border: 1px solid #000000;
  9. }
  10. table th,
  11. table td {
  12. min-width: 1em;
  13. }
  14. table th {
  15. background: #dadada;
  16. font-weight: normal;
  17. }
  18. table thead th {
  19. color: #ffffff;
  20. background: #666666;
  21. }
  22. </style>
  23. <div id="editor">
  24. <p>Table with everything:</p>
  25. <table>
  26. <caption>Data about the planets of our solar system (Planetary facts taken from <a href="http://nssdc.gsfc.nasa.gov/planetary/factsheet/" class="external external-icon" rel="noopener">Nasa's Planetary Fact Sheet - Metric</a>.</caption>
  27. <thead>
  28. <tr>
  29. <td colspan="2">&nbsp;</td>
  30. <th scope="col">Name</th>
  31. <th scope="col">Mass (10<sup>24</sup>kg)</th>
  32. <th scope="col">Diameter (km)</th>
  33. <th scope="col">Density (kg/m<sup>3</sup>)</th>
  34. <th scope="col">Gravity (m/s<sup>2</sup>)</th>
  35. <th scope="col">Length of day (hours)</th>
  36. <th scope="col">Distance from Sun (10<sup>6</sup>km)</th>
  37. <th scope="col">Mean temperature (°C)</th>
  38. <th scope="col">Number of moons</th>
  39. <th scope="col">Notes</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. <tr>
  44. <th colspan="2" rowspan="4" scope="rowgroup">Terrestial planets</th>
  45. <th scope="row">Mercury</th>
  46. <td>0.330</td>
  47. <td>4,879</td>
  48. <td>5427</td>
  49. <td>3.7</td>
  50. <td>4222.6</td>
  51. <td>57.9</td>
  52. <td>167</td>
  53. <td>0</td>
  54. <td>Closest to the Sun</td>
  55. </tr>
  56. <tr>
  57. <th scope="row">Venus</th>
  58. <td>4.87</td>
  59. <td>12,104</td>
  60. <td>5243</td>
  61. <td>8.9</td>
  62. <td>2802.0</td>
  63. <td>108.2</td>
  64. <td>464</td>
  65. <td>0</td>
  66. <td>&nbsp;</td>
  67. </tr>
  68. <tr>
  69. <th scope="row">Earth</th>
  70. <td>5.97</td>
  71. <td>12,756</td>
  72. <td>5514</td>
  73. <td>9.8</td>
  74. <td>24.0</td>
  75. <td>149.6</td>
  76. <td>15</td>
  77. <td>1</td>
  78. <td>Our world</td>
  79. </tr>
  80. <tr>
  81. <th scope="row">Mars</th>
  82. <td>0.642</td>
  83. <td>6,792</td>
  84. <td>3933</td>
  85. <td>3.7</td>
  86. <td>24.7</td>
  87. <td>227.9</td>
  88. <td>-65</td>
  89. <td>2</td>
  90. <td>The red planet</td>
  91. </tr>
  92. <tr>
  93. <th scope="rowgroup" rowspan="4">Jovian planets</th>
  94. <th scope="rowgroup" rowspan="2">Gas giants</th>
  95. <th scope="row">Jupiter</th>
  96. <td>1898</td>
  97. <td>142,984</td>
  98. <td>1326</td>
  99. <td>23.1</td>
  100. <td>9.9</td>
  101. <td>778.6</td>
  102. <td>-110</td>
  103. <td>67</td>
  104. <td>The largest planet</td>
  105. </tr>
  106. <tr>
  107. <th scope="row">Saturn</th>
  108. <td>568</td>
  109. <td>120,536</td>
  110. <td>687</td>
  111. <td>9.0</td>
  112. <td>10.7</td>
  113. <td>1433.5</td>
  114. <td>-140</td>
  115. <td>62</td>
  116. <td>&nbsp;</td>
  117. </tr>
  118. <tr>
  119. <th scope="rowgroup" rowspan="2">Ice giants</th>
  120. <th scope="row">Uranus</th>
  121. <td>86.8</td>
  122. <td>51,118</td>
  123. <td>1271</td>
  124. <td>8.7</td>
  125. <td>17.2</td>
  126. <td>2872.5</td>
  127. <td>-195</td>
  128. <td>27</td>
  129. <td>&nbsp;</td>
  130. </tr>
  131. <tr>
  132. <th scope="row">Neptune</th>
  133. <td>102</td>
  134. <td>49,528</td>
  135. <td>1638</td>
  136. <td>11.0</td>
  137. <td>16.1</td>
  138. <td>4495.1</td>
  139. <td>-200</td>
  140. <td>14</td>
  141. <td>&nbsp;</td>
  142. </tr>
  143. <tr>
  144. <th colspan="2" scope="rowgroup">Dwarf planets</th>
  145. <th scope="row">Pluto</th>
  146. <td>0.0146</td>
  147. <td>2,370</td>
  148. <td>2095</td>
  149. <td>0.7</td>
  150. <td>153.3</td>
  151. <td>5906.4</td>
  152. <td>-225</td>
  153. <td>5</td>
  154. <td>Declassified as a planet in 2006, but this <a href="http://www.usatoday.com/story/tech/2014/10/02/pluto-planet-solar-system/16578959/" class="external external-icon" rel="noopener">remains controversial</a>.</td>
  155. </tr>
  156. </tbody>
  157. </table>
  158. <p>Table with 2 tbody:</p>
  159. <table>
  160. <tbody>
  161. <tr>
  162. <td>a</td>
  163. <td>b</td>
  164. <td>c</td>
  165. </tr>
  166. </tbody>
  167. <tbody>
  168. <tr>
  169. <td>a</td>
  170. <td>b</td>
  171. <td>c</td>
  172. </tr>
  173. </tbody>
  174. </table>
  175. <p>Table with no tbody:</p>
  176. <table>
  177. <tr>
  178. <td>a</td>
  179. <td>b</td>
  180. <td>c</td>
  181. </tr>
  182. <tr>
  183. <td>a</td>
  184. <td>b</td>
  185. <td>c</td>
  186. </tr>
  187. </table>
  188. </div>