example05_tables.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017
  1. <?php
  2. $html = '
  3. <h1>mPDF</h1>
  4. <h2>Tables</h2>
  5. <h3>CSS Styles</h3>
  6. <p>The CSS properties for tables and cells is increased over that in html2fpdf. It includes recognition of THEAD, TFOOT and TH.<br />See below for other facilities such as autosizing, and rotation.</p>
  7. <table border="1">
  8. <tbody><tr><td>Row 1</td><td>This is data</td><td>This is data</td></tr>
  9. <tr><td>Row 2</td>
  10. <td style="background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;">
  11. <p>This is data p</p>
  12. This is data out of p
  13. <p style="font-weight:bold; font-size:20pt; background-color:#FFBBFF;">This is bold data p</p>
  14. <b>This is bold data out of p</b><br />
  15. This is normal data after br
  16. <h3>H3 in a table</h3>
  17. <div>This is data div</div>
  18. This is data out of div
  19. <div style="font-weight:bold;">This is data div (bold)</div>
  20. This is data out of div
  21. </td>
  22. <td><p>More data</p><p style="font-size:12pt;">This is large text</p></td></tr>
  23. <tr><td><p>Row 3</p></td><td><p>This is long data</p></td><td>This is data</td></tr>
  24. <tr><td><p>Row 4 &lt;td&gt; cell</p></td><td>This is data</td><td><p>This is data</p></td></tr>
  25. <tr><td>Row 5</td><td>Also data</td><td>Also data</td></tr>
  26. <tr><td>Row 6</td><td>Also data</td><td>Also data</td></tr>
  27. <tr><td>Row 7</td><td>Also data</td><td>Also data</td></tr>
  28. <tr><td>Row 8</td><td>Also data</td><td>Also data</td></tr>
  29. </tbody></table>
  30. <p>This table has padding-left and -right set to 5mm i.e. padding within the cells. Also border colour and style, font family and size are set by <acronym>CSS</acronym>.</p>
  31. <table align="right" style="border: 1px solid #880000; font-family: Mono; font-size: 7pt; " class="widecells">
  32. <tbody><tr><td>Row 1</td><td>This is data</td><td>This is data</td></tr>
  33. <tr><td>Row 2</td><td><p>This is data p</p></td><td><p>More data</p></td></tr>
  34. <tr><td><p>Row 3</p></td><td><p>This is long data</p></td><td>This is data</td></tr>
  35. <tr><td><p>Row 4 &lt;td&gt; cell</p></td><td>This is data</td><td><p>This is data</p></td></tr>
  36. <tr><td>Row 5</td><td>Also data</td><td>Also data</td></tr>
  37. <tr><td>Row 6</td><td>Also data</td><td>Also data</td></tr>
  38. <tr><td>Row 7</td><td>Also data</td><td>Also data</td></tr>
  39. <tr><td>Row 8</td><td>Also data</td><td>Also data</td></tr>
  40. </tbody></table>
  41. <p>This table has padding-top and -bottom set to 3mm i.e. padding within the cells. Also background-, border colour and style, font family and size are set by in-line <acronym>CSS</acronym>.</p>
  42. <table style="border: 1px solid #880000; background-color: #BBCCDD; font-family: Mono; font-size: 7pt; " class="tallcells">
  43. <tbody><tr><td>Row 1</td><td>This is data</td><td>This is data</td></tr>
  44. <tr><td>Row 2</td><td><p>This is data p</p></td><td><p>More data</p></td></tr>
  45. <tr><td><p>Row 3</p></td><td><p>This is long data</p></td><td>This is data</td></tr>
  46. </tbody></table>
  47. <h3 style="margin-top: 20pt; margin-collapse:collapse;">Table Styles</h3>
  48. <p>The style sheet used for these examples shows some of the table styles I use on my website. The property \'topntail\' defined by a border-type definition e.g. "1px solid #880000" puts a border at the top and bottom of the table, and also below a header row (thead) if defined. Note also that &lt;thead&gt; will automatically turn on the header-repeat i.e. reproduce the header row at the top of each page.</p>
  49. <p>bpmTopic Class</p>
  50. <table class="bpmTopic"><thead></thead><tbody>
  51. <tr>
  52. <td>Row 1</td>
  53. <td>This is data</td>
  54. <td>This is data</td>
  55. </tr>
  56. <tr>
  57. <td>Row 2</td>
  58. <td>
  59. <p>This is data p</p>
  60. </td>
  61. <td>
  62. <p>More data</p>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td>
  67. <p>Row 3</p>
  68. </td>
  69. <td>
  70. <p>This is long data</p>
  71. </td>
  72. <td>This is data</td>
  73. </tr>
  74. <tr>
  75. <td>
  76. <p>Row 4 &lt;td&gt; cell</p>
  77. </td>
  78. <td>This is data</td>
  79. <td>
  80. <p>This is data</p>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td>Row 5</td>
  85. <td>Also data</td>
  86. <td>Also data</td>
  87. </tr>
  88. <tr>
  89. <td>Row 6</td>
  90. <td>Also data</td>
  91. <td>Also data</td>
  92. </tr>
  93. <tr>
  94. <td>Row 7</td>
  95. <td>Also data</td>
  96. <td>Also data</td>
  97. </tr>
  98. <tr>
  99. <td>Row 8</td>
  100. <td>Also data</td>
  101. <td>Also data</td>
  102. </tr>
  103. </tbody></table>
  104. <p>&nbsp;</p>
  105. <p>bpmTopic<b>C</b> Class (centered) Odd and Even rows</p>
  106. <table class="bpmTopicC"><thead>
  107. <tr class="headerrow"><th>Col/Row Header</th>
  108. <td>
  109. <p>Second column header p</p>
  110. </td>
  111. <td>Third column header</td>
  112. </tr>
  113. </thead><tbody>
  114. <tr class="oddrow"><th>Row header 1</th>
  115. <td>This is data</td>
  116. <td>This is data</td>
  117. </tr>
  118. <tr class="evenrow"><th>Row header 2</th>
  119. <td>
  120. <p>This is data p</p>
  121. </td>
  122. <td>
  123. <p>This is data</p>
  124. </td>
  125. </tr>
  126. <tr class="oddrow"><th>
  127. <p>Row header 3</p>
  128. </th>
  129. <td>
  130. <p>This is long data</p>
  131. </td>
  132. <td>This is data</td>
  133. </tr>
  134. <tr class="evenrow"><th>
  135. <p>Row header 4</p>
  136. <p>&lt;th&gt; cell acting as header</p>
  137. </th>
  138. <td>This is data</td>
  139. <td>
  140. <p>This is data</p>
  141. </td>
  142. </tr>
  143. <tr class="oddrow"><th>Row header 5</th>
  144. <td>Also data</td>
  145. <td>Also data</td>
  146. </tr>
  147. <tr class="evenrow"><th>Row header 6</th>
  148. <td>Also data</td>
  149. <td>Also data</td>
  150. </tr>
  151. <tr class="oddrow"><th>Row header 7</th>
  152. <td>Also data</td>
  153. <td>Also data</td>
  154. </tr>
  155. <tr class="evenrow"><th>Row header 8</th>
  156. <td>Also data</td>
  157. <td>Also data</td>
  158. </tr>
  159. </tbody></table>
  160. <p>&nbsp;</p>
  161. <p>bpmTopnTail Class </p>
  162. <table class="bpmTopnTail"><thead></thead><tbody>
  163. <tr>
  164. <td>Row 1</td>
  165. <td>This is data</td>
  166. <td>This is data</td>
  167. </tr>
  168. <tr>
  169. <td>Row 2</td>
  170. <td>
  171. <p>This is data p</p>
  172. </td>
  173. <td>
  174. <p>This is data</p>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td>
  179. <p>Row 3</p>
  180. </td>
  181. <td>
  182. <p>This is long data</p>
  183. </td>
  184. <td>This is data</td>
  185. </tr>
  186. <tr>
  187. <td>
  188. <p>Row 4 &lt;td&gt; cell</p>
  189. </td>
  190. <td>This is data</td>
  191. <td>
  192. <p>This is data</p>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td>Row 5</td>
  197. <td>Also data</td>
  198. <td>Also data</td>
  199. </tr>
  200. <tr>
  201. <td>Row 6</td>
  202. <td>Also data</td>
  203. <td>Also data</td>
  204. </tr>
  205. <tr>
  206. <td>Row 7</td>
  207. <td>Also data</td>
  208. <td>Also data</td>
  209. </tr>
  210. <tr>
  211. <td>Row 8</td>
  212. <td>Also data</td>
  213. <td>Also data</td>
  214. </tr>
  215. </tbody></table>
  216. <p>&nbsp;</p>
  217. <p>bpmTopnTail<b>C</b> Class (centered) Odd and Even rows</p>
  218. <table class="bpmTopnTailC"><thead>
  219. <tr class="headerrow"><th>Col/Row Header</th>
  220. <td>
  221. <p>Second column header p</p>
  222. </td>
  223. <td>Third column header</td>
  224. </tr>
  225. </thead><tbody>
  226. <tr class="oddrow"><th>Row header 1</th>
  227. <td>This is data</td>
  228. <td>This is data</td>
  229. </tr>
  230. <tr class="evenrow"><th>Row header 2</th>
  231. <td>
  232. <p>This is data p</p>
  233. </td>
  234. <td>
  235. <p>This is data</p>
  236. </td>
  237. </tr>
  238. <tr class="oddrow"><th>
  239. <p>Row header 3</p>
  240. </th>
  241. <td>
  242. <p>This is long data</p>
  243. </td>
  244. <td>This is data</td>
  245. </tr>
  246. <tr class="evenrow"><th>
  247. <p>Row header 4</p>
  248. <p>&lt;th&gt; cell acting as header</p>
  249. </th>
  250. <td>This is data</td>
  251. <td>
  252. <p>This is data</p>
  253. </td>
  254. </tr>
  255. <tr class="oddrow"><th>Row header 5</th>
  256. <td>Also data</td>
  257. <td>Also data</td>
  258. </tr>
  259. <tr class="evenrow"><th>Row header 6</th>
  260. <td>Also data</td>
  261. <td>Also data</td>
  262. </tr>
  263. <tr class="oddrow"><th>Row header 7</th>
  264. <td>Also data</td>
  265. <td>Also data</td>
  266. </tr>
  267. <tr class="evenrow"><th>Row header 8</th>
  268. <td>Also data</td>
  269. <td>Also data</td>
  270. </tr>
  271. </tbody></table>
  272. <p>&nbsp;</p>
  273. <p>TopnTail Class</p>
  274. <table class="bpmTopnTail"><thead>
  275. <tr class="headerrow"><th>Col and Row Header</th>
  276. <td>
  277. <p>Second</p>
  278. <p>column</p>
  279. </td>
  280. <td class="pmhTopRight">Top right align</td>
  281. </tr>
  282. </thead><tbody>
  283. <tr class="oddrow"><th>
  284. <p>Row header 1 p</p>
  285. </th>
  286. <td>This is data</td>
  287. <td>This is data</td>
  288. </tr>
  289. <tr class="evenrow"><th>Row header 2</th>
  290. <td class="pmhBottomRight"><b><i>Bottom right align</i></b></td>
  291. <td>
  292. <p>This is data. Can use</p>
  293. <p><b>bold</b> <i>italic </i><sub>sub</sub> or <sup>sup</sup> text</p>
  294. </td>
  295. </tr>
  296. <tr class="oddrow"><th class="pmhBottomRight">
  297. <p>Bottom right align</p>
  298. </th>
  299. <td class="pmhMiddleCenter" style="border: #000000 1px solid">
  300. <p>This is data. This cell</p>
  301. <p>uses Cell Styles to set</p>
  302. <p>the borders.</p>
  303. <p>All borders are collapsible</p>
  304. <p>in mPDF.</p>
  305. </td>
  306. <td>This is data</td>
  307. </tr>
  308. <tr class="evenrow"><th>Row header 4</th>
  309. <td>
  310. <p>This is data p</p>
  311. </td>
  312. <td>More data</td>
  313. </tr>
  314. <tr class="oddrow"><th>Row header 5</th>
  315. <td colspan="2" class="pmhTopCenter">Also data merged and centered</td>
  316. </tr>
  317. </tbody></table>
  318. <p>&nbsp;</p>
  319. <h4>Lists in a Table</h4>
  320. <table class="bpmTopnTail"><thead>
  321. <tr class="headerrow"><th>Col and Row Header</th>
  322. <td>
  323. <p>Second</p>
  324. <p>column</p>
  325. </td>
  326. <td class="pmhTopRight">Top right align</td>
  327. </tr>
  328. </thead><tbody>
  329. <tr class="oddrow"><th>
  330. <p>Row header 1 p</p>
  331. </th>
  332. <td>This is data</td>
  333. <td>This is data</td>
  334. </tr>
  335. <tr class="evenrow"><th>Row header 2</th>
  336. <td>
  337. <ol>
  338. <li>Item 1</li>
  339. <li>Item 2
  340. <ol type="a">
  341. <li>Subitem of ordered list</li>
  342. <li>Subitem 2
  343. <ol type="i">
  344. <li>Level 3 subitem</li>
  345. <li>Level 3 subitem</li>
  346. </ol>
  347. </li>
  348. </ol>
  349. </li>
  350. <li>Item 3</li>
  351. <li>Another Item</li>
  352. <li>Subitem
  353. <ol>
  354. <li>Level 3 subitem</li>
  355. </ol>
  356. </li>
  357. <li>Another Item</li>
  358. </ol>
  359. </td>
  360. <td>
  361. Unordered list:
  362. <ul>
  363. <li>Item 1</li>
  364. <li>Item 2
  365. <ul>
  366. <li>Subitem of unordered list</li>
  367. <li>Subitem 2
  368. <ul>
  369. <li>Level 3 subitem</li>
  370. <li>Level 3 subitem</li>
  371. <li>Level 3 subitem</li>
  372. </ul>
  373. </li>
  374. </ul>
  375. </li>
  376. <li>Item 3</li>
  377. </ul>
  378. </td>
  379. </tr>
  380. </tbody></table>
  381. <p>&nbsp;</p>
  382. <h4>Automatic Column Width</h4>
  383. <table class="bpmTopnTail"><tbody>
  384. <tr>
  385. <td>Causes</td>
  386. <td>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. <br />
  387. Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.<br />
  388. Suspendisse potenti</td>
  389. </tr>
  390. <tr>
  391. <td>Mechanisms</td>
  392. <td>Ut magna ipsum, tempus in, condimentum at, rutrum et, nisl. Vestibulum interdum luctus sapien. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Maecenas consectetuer eros quis massa. Mauris semper velit vehicula purus. Duis lacus. Aenean pretium consectetuer mauris. Ut purus sem, consequat ut, fermentum sit amet, ornare sit amet, ipsum. Donec non nunc. Maecenas fringilla. Curabitur libero. In dui massa, malesuada sit amet, hendrerit vitae, viverra nec, tortor. Donec varius. Ut ut dolor et tellus adipiscing adipiscing.</td>
  393. </tr>
  394. </tbody></table>
  395. <h4>ColSpan & Rowspan</h4>
  396. <table class="bpmTopnTail"><tbody>
  397. <tr>
  398. <td rowspan="2">Causes</td>
  399. <td colspan="2">Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. <br />
  400. Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.<br />
  401. Suspendisse potenti</td>
  402. </tr>
  403. <tr>
  404. <td>Fusce eleifend neque sit amet erat.<br />
  405. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus.</td>
  406. <td>Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla.<br />
  407. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien.</td>
  408. </tr>
  409. </tbody></table>
  410. <h4>Table Header & Footer Rows</h4>
  411. <p>A table using a header row should repeat the header row across pages:</p>
  412. <p>bpmTopic<b>C</b> Class</p>
  413. <table class="bpmTopicC">
  414. <thead>
  415. <tr class="headerrow"><th>Col and Row Header</th>
  416. <td>
  417. <p>Second column header</p>
  418. </td>
  419. <td>Third column header</td>
  420. </tr>
  421. </thead>
  422. <tfoot>
  423. <tr class="footerrow"><th>Col and Row Footer</th>
  424. <td>
  425. <p>Second column footer</p>
  426. </td>
  427. <td>Third column footer</td>
  428. </tr>
  429. </tfoot>
  430. <tbody>
  431. <tr><th>Row header 1</th>
  432. <td>This is data</td>
  433. <td>This is data</td>
  434. </tr>
  435. <tr><th>Row header 2</th>
  436. <td>This is data</td>
  437. <td>
  438. <p>This is data</p>
  439. </td>
  440. </tr>
  441. <tr><th>
  442. <p>Row header 3</p>
  443. </th>
  444. <td>
  445. <p>This is data</p>
  446. </td>
  447. <td>This is data</td>
  448. </tr>
  449. <tr><th>Row header 4</th>
  450. <td>This is data</td>
  451. <td>
  452. <p>This is data</p>
  453. </td>
  454. </tr>
  455. <tr><th>Row header 5</th>
  456. <td>Also data</td>
  457. <td>Also data</td>
  458. </tr>
  459. <tr><th>Row header 6</th>
  460. <td>Also data</td>
  461. <td>Also data</td>
  462. </tr>
  463. <tr><th>Row header 7</th>
  464. <td>Also data</td>
  465. <td>Also data</td>
  466. </tr>
  467. <tr><th>Row header 8</th>
  468. <td>Also data</td>
  469. <td>Also data</td>
  470. </tr>
  471. <tr><th>Row header 9</th>
  472. <td>Also data</td>
  473. <td>Also data</td>
  474. </tr>
  475. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  476. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  477. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  478. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  479. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  480. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  481. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  482. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  483. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  484. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  485. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  486. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  487. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  488. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  489. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  490. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  491. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  492. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  493. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  494. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  495. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  496. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  497. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  498. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  499. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  500. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  501. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  502. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  503. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  504. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  505. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  506. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  507. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  508. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  509. <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
  510. </tbody></table>
  511. <p>&nbsp;</p>
  512. <h3>Autosizing Tables</h3>
  513. <p>Periodic Table of elements. Tables are set by default to reduce font size if complete words will not fit inside each cell, to a maximum of 1/1.4 * the set font-size. This value can be changed by setting $mpdf->shrink_tables_to_fit=1.8 or using html attribute &lt;table autosize="1.8"&gt;.</p>
  514. <h5>Periodic Table</h5>
  515. <table style="border:1px solid #000000;" cellPadding="9"><thead>
  516. <tr><th>1A</th><th>2A</th><th>3B</th><th>4B</th><th>5B</th><th>6B</th><th>7B</th><th>8B</th><th>8B</th><th>8B</th><th>1B</th><th>2B</th><th>3A</th><th>4A</th><th>5A</th><th>6A</th><th>7A</th><th>8A</th></tr></thead><tbody>
  517. <tr>
  518. <td colspan="18"></td>
  519. </tr>
  520. <tr>
  521. <td>H </td>
  522. <td colspan="16"></td>
  523. <td>He </td>
  524. </tr>
  525. <tr>
  526. <td>Li </td>
  527. <td>Be </td>
  528. <td colspan="10"></td>
  529. <td>B </td>
  530. <td>C </td>
  531. <td>N </td>
  532. <td>O </td>
  533. <td>F </td>
  534. <td>Ne </td>
  535. </tr>
  536. <tr>
  537. <td>Na </td>
  538. <td>Mg </td>
  539. <td colspan="10"></td>
  540. <td>Al </td>
  541. <td>Si </td>
  542. <td>P </td>
  543. <td>S </td>
  544. <td>Cl </td>
  545. <td>Ar </td>
  546. </tr>
  547. <tr>
  548. <td>K </td>
  549. <td>Ca </td>
  550. <td>Sc </td>
  551. <td>Ti </td>
  552. <td>V </td>
  553. <td>Cr </td>
  554. <td>Mn </td>
  555. <td>Fe </td>
  556. <td>Co </td>
  557. <td>Ni </td>
  558. <td>Cu </td>
  559. <td>Zn </td>
  560. <td>Ga </td>
  561. <td>Ge </td>
  562. <td>As </td>
  563. <td>Se </td>
  564. <td>Br </td>
  565. <td>Kr </td>
  566. </tr>
  567. <tr>
  568. <td>Rb </td>
  569. <td>Sr </td>
  570. <td>Y </td>
  571. <td>Zr </td>
  572. <td>Nb </td>
  573. <td>Mo </td>
  574. <td>Tc </td>
  575. <td>Ru </td>
  576. <td>Rh </td>
  577. <td>Pd </td>
  578. <td>Ag </td>
  579. <td>Cd </td>
  580. <td>In </td>
  581. <td>Sn </td>
  582. <td>Sb </td>
  583. <td>Te </td>
  584. <td>I </td>
  585. <td>Xe </td>
  586. </tr>
  587. <tr>
  588. <td>Cs </td>
  589. <td>Ba </td>
  590. <td>La </td>
  591. <td>Hf </td>
  592. <td>Ta </td>
  593. <td>W </td>
  594. <td>Re </td>
  595. <td>Os </td>
  596. <td>Ir </td>
  597. <td>Pt </td>
  598. <td>Au </td>
  599. <td>Hg </td>
  600. <td>Tl </td>
  601. <td>Pb </td>
  602. <td>Bi </td>
  603. <td>Po </td>
  604. <td>At </td>
  605. <td>Rn </td>
  606. </tr>
  607. <tr>
  608. <td>Fr </td>
  609. <td>Ra </td>
  610. <td>Ac </td>
  611. <td colspan="15"></td>
  612. </tr>
  613. <tr>
  614. <td colspan="18"></td>
  615. </tr>
  616. <tr>
  617. <td colspan="3"></td>
  618. <td>Ce </td>
  619. <td>Pr </td>
  620. <td>Nd </td>
  621. <td>Pm </td>
  622. <td>Sm </td>
  623. <td>Eu </td>
  624. <td>Gd </td>
  625. <td>Tb </td>
  626. <td>Dy </td>
  627. <td>Ho </td>
  628. <td>Er </td>
  629. <td>Tm </td>
  630. <td>Yb </td>
  631. <td>Lu </td>
  632. <td></td>
  633. </tr>
  634. <tr>
  635. <td colspan="3"></td>
  636. <td>Th </td>
  637. <td>Pa </td>
  638. <td>U </td>
  639. <td>Np </td>
  640. <td>Pu </td>
  641. <td>Am </td>
  642. <td>Cm </td>
  643. <td>Bk </td>
  644. <td>Cf </td>
  645. <td>Es </td>
  646. <td>Fm </td>
  647. <td>Md </td>
  648. <td>No </td>
  649. <td>Lr </td>
  650. <td></td>
  651. </tr>
  652. </tbody></table>
  653. <pagebreak />
  654. <h3>Rotating Tables</h3>
  655. <p>This is set to rotate -90 degrees (counterclockwise).</p>
  656. <h5>Periodic Table</h5>
  657. <p>
  658. <table rotate="-90" class="bpmClearC"><thead>
  659. <tr><th>1A</th><th>2A</th><th>3B</th><th>4B</th><th>5B</th><th>6B</th><th>7B</th><th>8B</th><th>8B</th><th>8B</th><th>1B</th><th>2B</th><th>3A</th><th>4A</th><th>5A</th><th>6A</th><th>7A</th><th>8A</th></tr></thead><tbody>
  660. <tr>
  661. <td></td>
  662. <td colspan="18"></td>
  663. </tr>
  664. <tr>
  665. <td>H </td>
  666. <td colspan="15"></td>
  667. <td></td>
  668. <td>He </td>
  669. </tr>
  670. <tr>
  671. <td>Li </td>
  672. <td>Be </td>
  673. <td colspan="10"></td>
  674. <td>B </td>
  675. <td>C </td>
  676. <td>N </td>
  677. <td>O </td>
  678. <td>F </td>
  679. <td>Ne </td>
  680. </tr>
  681. <tr>
  682. <td>Na </td>
  683. <td>Mg </td>
  684. <td colspan="10"></td>
  685. <td>Al </td>
  686. <td>Si </td>
  687. <td>P </td>
  688. <td>S </td>
  689. <td>Cl </td>
  690. <td>Ar </td>
  691. </tr>
  692. <tr>
  693. <td>K </td>
  694. <td>Ca </td>
  695. <td>Sc </td>
  696. <td>Ti </td>
  697. <td>V </td>
  698. <td>Cr </td>
  699. <td>Mn </td>
  700. <td>Fe </td>
  701. <td>Co </td>
  702. <td>Ni </td>
  703. <td>Cu </td>
  704. <td>Zn </td>
  705. <td>Ga </td>
  706. <td>Ge </td>
  707. <td>As </td>
  708. <td>Se </td>
  709. <td>Br </td>
  710. <td>Kr </td>
  711. </tr>
  712. <tr>
  713. <td>Rb </td>
  714. <td>Sr </td>
  715. <td>Y </td>
  716. <td>Zr </td>
  717. <td>Nb </td>
  718. <td>Mo </td>
  719. <td>Tc </td>
  720. <td>Ru </td>
  721. <td>Rh </td>
  722. <td>Pd </td>
  723. <td>Ag </td>
  724. <td>Cd </td>
  725. <td>In </td>
  726. <td>Sn </td>
  727. <td>Sb </td>
  728. <td>Te </td>
  729. <td>I </td>
  730. <td>Xe </td>
  731. </tr>
  732. <tr>
  733. <td>Cs </td>
  734. <td>Ba </td>
  735. <td>La </td>
  736. <td>Hf </td>
  737. <td>Ta </td>
  738. <td>W </td>
  739. <td>Re </td>
  740. <td>Os </td>
  741. <td>Ir </td>
  742. <td>Pt </td>
  743. <td>Au </td>
  744. <td>Hg </td>
  745. <td>Tl </td>
  746. <td>Pb </td>
  747. <td>Bi </td>
  748. <td>Po </td>
  749. <td>At </td>
  750. <td>Rn </td>
  751. </tr>
  752. <tr>
  753. <td>Fr </td>
  754. <td>Ra </td>
  755. <td>Ac </td>
  756. </tr>
  757. <tr>
  758. <td></td>
  759. <td colspan="18"></td>
  760. </tr>
  761. <tr>
  762. <td colspan="3"></td>
  763. <td>Ce </td>
  764. <td>Pr </td>
  765. <td>Nd </td>
  766. <td>Pm </td>
  767. <td>Sm </td>
  768. <td>Eu </td>
  769. <td>Gd </td>
  770. <td>Tb </td>
  771. <td>Dy </td>
  772. <td>Ho </td>
  773. <td>Er </td>
  774. <td>Tm </td>
  775. <td>Yb </td>
  776. <td>Lu </td>
  777. <td></td>
  778. </tr>
  779. <tr>
  780. <td colspan="3"></td>
  781. <td>Th </td>
  782. <td>Pa </td>
  783. <td>U </td>
  784. <td>Np </td>
  785. <td>Pu </td>
  786. <td>Am </td>
  787. <td>Cm </td>
  788. <td>Bk </td>
  789. <td>Cf </td>
  790. <td>Es </td>
  791. <td>Fm </td>
  792. <td>Md </td>
  793. <td>No </td>
  794. <td>Lr </td>
  795. <td></td>
  796. </tr>
  797. </tbody></table>
  798. <p>&nbsp;</p>
  799. <pagebreak />
  800. <h3>Rotated text in Table Cells</h3>
  801. <h5>Periodic Table</h5>
  802. <table>
  803. <thead>
  804. <tr text-rotate="45">
  805. <th><p>Element type 1A</p><p>Second line</p><th><p>Element type longer 2A</p></th>
  806. <th>Element type 3B</th>
  807. <th>Element type 4B</th>
  808. <th>Element type 5B</th>
  809. <th>Element type 6B</th>
  810. <th>7B</th><th>8B</th>
  811. <th>Element type 8B R</th>
  812. <th>8B</th>
  813. <th>Element <span>type</span> 1B</th>
  814. <th>2B</th>
  815. <th>Element type 3A</th>
  816. <th>Element type 4A</th>
  817. <th>Element type 5A</th>
  818. <th>Element type 6A</th>
  819. <th>7A</th>
  820. <th>Element type 8A</th>
  821. </tr>
  822. </thead>
  823. <tbody>
  824. <tr>
  825. <td>H</td>
  826. <td colspan="15"></td>
  827. <td></td>
  828. <td>He </td>
  829. </tr>
  830. <tr>
  831. <td>Li </td>
  832. <td>Be </td>
  833. <td colspan="10"></td>
  834. <td>B </td>
  835. <td>C </td>
  836. <td>N </td>
  837. <td>O </td>
  838. <td>F </td>
  839. <td>Ne </td>
  840. </tr>
  841. <tr>
  842. <td>Na </td>
  843. <td>Mg </td>
  844. <td colspan="10"></td>
  845. <td>Al </td>
  846. <td>Si </td>
  847. <td>P </td>
  848. <td>S </td>
  849. <td>Cl </td>
  850. <td>Ar </td>
  851. </tr>
  852. <tr style="text-rotate: 45">
  853. <td>K </td>
  854. <td>Ca </td>
  855. <td>Sc </td>
  856. <td>Ti</td>
  857. <td>Va</td>
  858. <td>Cr</td>
  859. <td>Mn</td>
  860. <td>Fe</td>
  861. <td>Co</td>
  862. <td>Ni </td>
  863. <td>Cu </td>
  864. <td>Zn </td>
  865. <td>Ga </td>
  866. <td>Ge </td>
  867. <td>As </td>
  868. <td>Se </td>
  869. <td>Br </td>
  870. <td>Kr </td>
  871. </tr>
  872. <tr>
  873. <td>Rb </td>
  874. <td>Sr </td>
  875. <td>Y </td>
  876. <td>Zr </td>
  877. <td>Nb </td>
  878. <td>Mo </td>
  879. <td>Tc </td>
  880. <td>Ru </td>
  881. <td style="text-align:right; ">Rh</td>
  882. <td>Pd </td>
  883. <td>Ag </td>
  884. <td>Cd </td>
  885. <td>In </td>
  886. <td>Sn </td>
  887. <td>Sb </td>
  888. <td>Te </td>
  889. <td>I </td>
  890. <td>Xe </td>
  891. </tr>
  892. <tr>
  893. <td>Cs </td>
  894. <td>Ba </td>
  895. <td>La </td>
  896. <td>Hf </td>
  897. <td>Ta </td>
  898. <td>W </td>
  899. <td>Re </td>
  900. <td>Os </td>
  901. <td>Ir </td>
  902. <td>Pt </td>
  903. <td>Au </td>
  904. <td>Hg </td>
  905. <td>Tl </td>
  906. <td>Pb </td>
  907. <td>Bi </td>
  908. <td>Po </td>
  909. <td>At </td>
  910. <td>Rn </td>
  911. </tr>
  912. <tr>
  913. <td>Fr </td>
  914. <td>Ra </td>
  915. <td colspan="16">Ac </td>
  916. </tr>
  917. <tr>
  918. <td colspan="3"></td>
  919. <td>Ce </td>
  920. <td>Pr </td>
  921. <td>Nd </td>
  922. <td>Pm </td>
  923. <td>Sm </td>
  924. <td>Eu </td>
  925. <td>Gd </td>
  926. <td>Tb </td>
  927. <td>Dy </td>
  928. <td>Ho </td>
  929. <td>Er </td>
  930. <td>Tm </td>
  931. <td>Yb </td>
  932. <td>Lu </td>
  933. <td></td>
  934. </tr>
  935. <tr>
  936. <td colspan="3"></td>
  937. <td>Th </td>
  938. <td>Pa </td>
  939. <td>U </td>
  940. <td>Np </td>
  941. <td>Pu </td>
  942. <td>Am </td>
  943. <td>Cm </td>
  944. <td>Bk </td>
  945. <td>Cf </td>
  946. <td>Es </td>
  947. <td>Fm </td>
  948. <td>Md </td>
  949. <td>No </td>
  950. <td>Lr </td>
  951. <td></td>
  952. </tr>
  953. </tbody></table>
  954. <p>&nbsp;</p>
  955. ';
  956. //==============================================================
  957. //==============================================================
  958. //==============================================================
  959. include("../mpdf.php");
  960. $mpdf=new mPDF('c','A4','','',32,25,27,25,16,13);
  961. $mpdf->SetDisplayMode('fullpage');
  962. $mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
  963. // LOAD a stylesheet
  964. $stylesheet = file_get_contents('mpdfstyletables.css');
  965. $mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text
  966. $mpdf->WriteHTML($html,2);
  967. $mpdf->Output('mpdf.pdf','I');
  968. exit;
  969. //==============================================================
  970. //==============================================================
  971. //==============================================================
  972. ?>