index_column.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
  6. <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
  7. <title>FixedColumns example - Index column</title>
  8. <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
  9. <link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.css">
  10. <link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
  11. <link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
  12. <style type="text/css" class="init">
  13. /* Ensure that the demo table scrolls */
  14. th, td { white-space: nowrap; }
  15. div.dataTables_wrapper {
  16. width: 800px;
  17. margin: 0 auto;
  18. }
  19. /* Styling for the index columns */
  20. th.index,
  21. td.index {
  22. background-color: white !important;
  23. border-top: 1px solid white !important;
  24. border-bottom: none !important;
  25. }
  26. div.DTFC_LeftHeadWrapper table {
  27. border-bottom: 1px solid white !important;
  28. }
  29. div.DTFC_LeftHeadWrapper th {
  30. border-bottom: 1px solid white !important;
  31. }
  32. div.DTFC_LeftBodyWrapper {
  33. border-right: 1px solid black;
  34. }
  35. div.DTFC_LeftFootWrapper th {
  36. border-top: 1px solid white !important;
  37. }
  38. </style>
  39. <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
  40. <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
  41. <script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
  42. <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
  43. <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
  44. <script type="text/javascript" language="javascript" class="init">
  45. $(document).ready(function() {
  46. var table = $('#example').DataTable( {
  47. scrollY: "300px",
  48. scrollX: true,
  49. scrollCollapse: true,
  50. paging: false,
  51. columnDefs: [ {
  52. sortable: false,
  53. "class": "index",
  54. targets: 0
  55. } ],
  56. order: [[ 1, 'asc' ]]
  57. } );
  58. table.on( 'order.dt search.dt', function () {
  59. table.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
  60. cell.innerHTML = i+1;
  61. } );
  62. } ).draw();
  63. new $.fn.dataTable.FixedColumns( table );
  64. } );
  65. </script>
  66. </head>
  67. <body class="dt-example">
  68. <div class="container">
  69. <section>
  70. <h1>FixedColumns example <span>Index column</span></h1>
  71. <div class="info">
  72. <p>A typical interaction to want to perform with a fixed column, is an index column. A method for how this can be achieved with FixedColumns is shown in this
  73. example, building on the <a href="http://datatables.net/examples/api/counter_column">index column</a> example for DataTables. Also shown in this example is how the
  74. fixed column can be styled with CSS to show it more prominently.</p>
  75. </div>
  76. <table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
  77. <thead>
  78. <tr>
  79. <th></th>
  80. <th>First name</th>
  81. <th>Last name</th>
  82. <th>Position</th>
  83. <th>Office</th>
  84. <th>Age</th>
  85. <th>Start date</th>
  86. <th>Salary</th>
  87. <th>Extn.</th>
  88. <th>E-mail</th>
  89. </tr>
  90. </thead>
  91. <tbody>
  92. <tr>
  93. <td></td>
  94. <td>Tiger</td>
  95. <td>Nixon</td>
  96. <td>System Architect</td>
  97. <td>Edinburgh</td>
  98. <td>61</td>
  99. <td>2011/04/25</td>
  100. <td>$320,800</td>
  101. <td>5421</td>
  102. <td>t.nixon@datatables.net</td>
  103. </tr>
  104. <tr>
  105. <td></td>
  106. <td>Garrett</td>
  107. <td>Winters</td>
  108. <td>Accountant</td>
  109. <td>Tokyo</td>
  110. <td>63</td>
  111. <td>2011/07/25</td>
  112. <td>$170,750</td>
  113. <td>8422</td>
  114. <td>g.winters@datatables.net</td>
  115. </tr>
  116. <tr>
  117. <td></td>
  118. <td>Ashton</td>
  119. <td>Cox</td>
  120. <td>Junior Technical Author</td>
  121. <td>San Francisco</td>
  122. <td>66</td>
  123. <td>2009/01/12</td>
  124. <td>$86,000</td>
  125. <td>1562</td>
  126. <td>a.cox@datatables.net</td>
  127. </tr>
  128. <tr>
  129. <td></td>
  130. <td>Cedric</td>
  131. <td>Kelly</td>
  132. <td>Senior Javascript Developer</td>
  133. <td>Edinburgh</td>
  134. <td>22</td>
  135. <td>2012/03/29</td>
  136. <td>$433,060</td>
  137. <td>6224</td>
  138. <td>c.kelly@datatables.net</td>
  139. </tr>
  140. <tr>
  141. <td></td>
  142. <td>Airi</td>
  143. <td>Satou</td>
  144. <td>Accountant</td>
  145. <td>Tokyo</td>
  146. <td>33</td>
  147. <td>2008/11/28</td>
  148. <td>$162,700</td>
  149. <td>5407</td>
  150. <td>a.satou@datatables.net</td>
  151. </tr>
  152. <tr>
  153. <td></td>
  154. <td>Brielle</td>
  155. <td>Williamson</td>
  156. <td>Integration Specialist</td>
  157. <td>New York</td>
  158. <td>61</td>
  159. <td>2012/12/02</td>
  160. <td>$372,000</td>
  161. <td>4804</td>
  162. <td>b.williamson@datatables.net</td>
  163. </tr>
  164. <tr>
  165. <td></td>
  166. <td>Herrod</td>
  167. <td>Chandler</td>
  168. <td>Sales Assistant</td>
  169. <td>San Francisco</td>
  170. <td>59</td>
  171. <td>2012/08/06</td>
  172. <td>$137,500</td>
  173. <td>9608</td>
  174. <td>h.chandler@datatables.net</td>
  175. </tr>
  176. <tr>
  177. <td></td>
  178. <td>Rhona</td>
  179. <td>Davidson</td>
  180. <td>Integration Specialist</td>
  181. <td>Tokyo</td>
  182. <td>55</td>
  183. <td>2010/10/14</td>
  184. <td>$327,900</td>
  185. <td>6200</td>
  186. <td>r.davidson@datatables.net</td>
  187. </tr>
  188. <tr>
  189. <td></td>
  190. <td>Colleen</td>
  191. <td>Hurst</td>
  192. <td>Javascript Developer</td>
  193. <td>San Francisco</td>
  194. <td>39</td>
  195. <td>2009/09/15</td>
  196. <td>$205,500</td>
  197. <td>2360</td>
  198. <td>c.hurst@datatables.net</td>
  199. </tr>
  200. <tr>
  201. <td></td>
  202. <td>Sonya</td>
  203. <td>Frost</td>
  204. <td>Software Engineer</td>
  205. <td>Edinburgh</td>
  206. <td>23</td>
  207. <td>2008/12/13</td>
  208. <td>$103,600</td>
  209. <td>1667</td>
  210. <td>s.frost@datatables.net</td>
  211. </tr>
  212. <tr>
  213. <td></td>
  214. <td>Jena</td>
  215. <td>Gaines</td>
  216. <td>Office Manager</td>
  217. <td>London</td>
  218. <td>30</td>
  219. <td>2008/12/19</td>
  220. <td>$90,560</td>
  221. <td>3814</td>
  222. <td>j.gaines@datatables.net</td>
  223. </tr>
  224. <tr>
  225. <td></td>
  226. <td>Quinn</td>
  227. <td>Flynn</td>
  228. <td>Support Lead</td>
  229. <td>Edinburgh</td>
  230. <td>22</td>
  231. <td>2013/03/03</td>
  232. <td>$342,000</td>
  233. <td>9497</td>
  234. <td>q.flynn@datatables.net</td>
  235. </tr>
  236. <tr>
  237. <td></td>
  238. <td>Charde</td>
  239. <td>Marshall</td>
  240. <td>Regional Director</td>
  241. <td>San Francisco</td>
  242. <td>36</td>
  243. <td>2008/10/16</td>
  244. <td>$470,600</td>
  245. <td>6741</td>
  246. <td>c.marshall@datatables.net</td>
  247. </tr>
  248. <tr>
  249. <td></td>
  250. <td>Haley</td>
  251. <td>Kennedy</td>
  252. <td>Senior Marketing Designer</td>
  253. <td>London</td>
  254. <td>43</td>
  255. <td>2012/12/18</td>
  256. <td>$313,500</td>
  257. <td>3597</td>
  258. <td>h.kennedy@datatables.net</td>
  259. </tr>
  260. <tr>
  261. <td></td>
  262. <td>Tatyana</td>
  263. <td>Fitzpatrick</td>
  264. <td>Regional Director</td>
  265. <td>London</td>
  266. <td>19</td>
  267. <td>2010/03/17</td>
  268. <td>$385,750</td>
  269. <td>1965</td>
  270. <td>t.fitzpatrick@datatables.net</td>
  271. </tr>
  272. <tr>
  273. <td></td>
  274. <td>Michael</td>
  275. <td>Silva</td>
  276. <td>Marketing Designer</td>
  277. <td>London</td>
  278. <td>66</td>
  279. <td>2012/11/27</td>
  280. <td>$198,500</td>
  281. <td>1581</td>
  282. <td>m.silva@datatables.net</td>
  283. </tr>
  284. <tr>
  285. <td></td>
  286. <td>Paul</td>
  287. <td>Byrd</td>
  288. <td>Chief Financial Officer (CFO)</td>
  289. <td>New York</td>
  290. <td>64</td>
  291. <td>2010/06/09</td>
  292. <td>$725,000</td>
  293. <td>3059</td>
  294. <td>p.byrd@datatables.net</td>
  295. </tr>
  296. <tr>
  297. <td></td>
  298. <td>Gloria</td>
  299. <td>Little</td>
  300. <td>Systems Administrator</td>
  301. <td>New York</td>
  302. <td>59</td>
  303. <td>2009/04/10</td>
  304. <td>$237,500</td>
  305. <td>1721</td>
  306. <td>g.little@datatables.net</td>
  307. </tr>
  308. <tr>
  309. <td></td>
  310. <td>Bradley</td>
  311. <td>Greer</td>
  312. <td>Software Engineer</td>
  313. <td>London</td>
  314. <td>41</td>
  315. <td>2012/10/13</td>
  316. <td>$132,000</td>
  317. <td>2558</td>
  318. <td>b.greer@datatables.net</td>
  319. </tr>
  320. <tr>
  321. <td></td>
  322. <td>Dai</td>
  323. <td>Rios</td>
  324. <td>Personnel Lead</td>
  325. <td>Edinburgh</td>
  326. <td>35</td>
  327. <td>2012/09/26</td>
  328. <td>$217,500</td>
  329. <td>2290</td>
  330. <td>d.rios@datatables.net</td>
  331. </tr>
  332. <tr>
  333. <td></td>
  334. <td>Jenette</td>
  335. <td>Caldwell</td>
  336. <td>Development Lead</td>
  337. <td>New York</td>
  338. <td>30</td>
  339. <td>2011/09/03</td>
  340. <td>$345,000</td>
  341. <td>1937</td>
  342. <td>j.caldwell@datatables.net</td>
  343. </tr>
  344. <tr>
  345. <td></td>
  346. <td>Yuri</td>
  347. <td>Berry</td>
  348. <td>Chief Marketing Officer (CMO)</td>
  349. <td>New York</td>
  350. <td>40</td>
  351. <td>2009/06/25</td>
  352. <td>$675,000</td>
  353. <td>6154</td>
  354. <td>y.berry@datatables.net</td>
  355. </tr>
  356. <tr>
  357. <td></td>
  358. <td>Caesar</td>
  359. <td>Vance</td>
  360. <td>Pre-Sales Support</td>
  361. <td>New York</td>
  362. <td>21</td>
  363. <td>2011/12/12</td>
  364. <td>$106,450</td>
  365. <td>8330</td>
  366. <td>c.vance@datatables.net</td>
  367. </tr>
  368. <tr>
  369. <td></td>
  370. <td>Doris</td>
  371. <td>Wilder</td>
  372. <td>Sales Assistant</td>
  373. <td>Sidney</td>
  374. <td>23</td>
  375. <td>2010/09/20</td>
  376. <td>$85,600</td>
  377. <td>3023</td>
  378. <td>d.wilder@datatables.net</td>
  379. </tr>
  380. <tr>
  381. <td></td>
  382. <td>Angelica</td>
  383. <td>Ramos</td>
  384. <td>Chief Executive Officer (CEO)</td>
  385. <td>London</td>
  386. <td>47</td>
  387. <td>2009/10/09</td>
  388. <td>$1,200,000</td>
  389. <td>5797</td>
  390. <td>a.ramos@datatables.net</td>
  391. </tr>
  392. <tr>
  393. <td></td>
  394. <td>Gavin</td>
  395. <td>Joyce</td>
  396. <td>Developer</td>
  397. <td>Edinburgh</td>
  398. <td>42</td>
  399. <td>2010/12/22</td>
  400. <td>$92,575</td>
  401. <td>8822</td>
  402. <td>g.joyce@datatables.net</td>
  403. </tr>
  404. <tr>
  405. <td></td>
  406. <td>Jennifer</td>
  407. <td>Chang</td>
  408. <td>Regional Director</td>
  409. <td>Singapore</td>
  410. <td>28</td>
  411. <td>2010/11/14</td>
  412. <td>$357,650</td>
  413. <td>9239</td>
  414. <td>j.chang@datatables.net</td>
  415. </tr>
  416. <tr>
  417. <td></td>
  418. <td>Brenden</td>
  419. <td>Wagner</td>
  420. <td>Software Engineer</td>
  421. <td>San Francisco</td>
  422. <td>28</td>
  423. <td>2011/06/07</td>
  424. <td>$206,850</td>
  425. <td>1314</td>
  426. <td>b.wagner@datatables.net</td>
  427. </tr>
  428. <tr>
  429. <td></td>
  430. <td>Fiona</td>
  431. <td>Green</td>
  432. <td>Chief Operating Officer (COO)</td>
  433. <td>San Francisco</td>
  434. <td>48</td>
  435. <td>2010/03/11</td>
  436. <td>$850,000</td>
  437. <td>2947</td>
  438. <td>f.green@datatables.net</td>
  439. </tr>
  440. <tr>
  441. <td></td>
  442. <td>Shou</td>
  443. <td>Itou</td>
  444. <td>Regional Marketing</td>
  445. <td>Tokyo</td>
  446. <td>20</td>
  447. <td>2011/08/14</td>
  448. <td>$163,000</td>
  449. <td>8899</td>
  450. <td>s.itou@datatables.net</td>
  451. </tr>
  452. <tr>
  453. <td></td>
  454. <td>Michelle</td>
  455. <td>House</td>
  456. <td>Integration Specialist</td>
  457. <td>Sidney</td>
  458. <td>37</td>
  459. <td>2011/06/02</td>
  460. <td>$95,400</td>
  461. <td>2769</td>
  462. <td>m.house@datatables.net</td>
  463. </tr>
  464. <tr>
  465. <td></td>
  466. <td>Suki</td>
  467. <td>Burks</td>
  468. <td>Developer</td>
  469. <td>London</td>
  470. <td>53</td>
  471. <td>2009/10/22</td>
  472. <td>$114,500</td>
  473. <td>6832</td>
  474. <td>s.burks@datatables.net</td>
  475. </tr>
  476. <tr>
  477. <td></td>
  478. <td>Prescott</td>
  479. <td>Bartlett</td>
  480. <td>Technical Author</td>
  481. <td>London</td>
  482. <td>27</td>
  483. <td>2011/05/07</td>
  484. <td>$145,000</td>
  485. <td>3606</td>
  486. <td>p.bartlett@datatables.net</td>
  487. </tr>
  488. <tr>
  489. <td></td>
  490. <td>Gavin</td>
  491. <td>Cortez</td>
  492. <td>Team Leader</td>
  493. <td>San Francisco</td>
  494. <td>22</td>
  495. <td>2008/10/26</td>
  496. <td>$235,500</td>
  497. <td>2860</td>
  498. <td>g.cortez@datatables.net</td>
  499. </tr>
  500. <tr>
  501. <td></td>
  502. <td>Martena</td>
  503. <td>Mccray</td>
  504. <td>Post-Sales support</td>
  505. <td>Edinburgh</td>
  506. <td>46</td>
  507. <td>2011/03/09</td>
  508. <td>$324,050</td>
  509. <td>8240</td>
  510. <td>m.mccray@datatables.net</td>
  511. </tr>
  512. <tr>
  513. <td></td>
  514. <td>Unity</td>
  515. <td>Butler</td>
  516. <td>Marketing Designer</td>
  517. <td>San Francisco</td>
  518. <td>47</td>
  519. <td>2009/12/09</td>
  520. <td>$85,675</td>
  521. <td>5384</td>
  522. <td>u.butler@datatables.net</td>
  523. </tr>
  524. <tr>
  525. <td></td>
  526. <td>Howard</td>
  527. <td>Hatfield</td>
  528. <td>Office Manager</td>
  529. <td>San Francisco</td>
  530. <td>51</td>
  531. <td>2008/12/16</td>
  532. <td>$164,500</td>
  533. <td>7031</td>
  534. <td>h.hatfield@datatables.net</td>
  535. </tr>
  536. <tr>
  537. <td></td>
  538. <td>Hope</td>
  539. <td>Fuentes</td>
  540. <td>Secretary</td>
  541. <td>San Francisco</td>
  542. <td>41</td>
  543. <td>2010/02/12</td>
  544. <td>$109,850</td>
  545. <td>6318</td>
  546. <td>h.fuentes@datatables.net</td>
  547. </tr>
  548. <tr>
  549. <td></td>
  550. <td>Vivian</td>
  551. <td>Harrell</td>
  552. <td>Financial Controller</td>
  553. <td>San Francisco</td>
  554. <td>62</td>
  555. <td>2009/02/14</td>
  556. <td>$452,500</td>
  557. <td>9422</td>
  558. <td>v.harrell@datatables.net</td>
  559. </tr>
  560. <tr>
  561. <td></td>
  562. <td>Timothy</td>
  563. <td>Mooney</td>
  564. <td>Office Manager</td>
  565. <td>London</td>
  566. <td>37</td>
  567. <td>2008/12/11</td>
  568. <td>$136,200</td>
  569. <td>7580</td>
  570. <td>t.mooney@datatables.net</td>
  571. </tr>
  572. <tr>
  573. <td></td>
  574. <td>Jackson</td>
  575. <td>Bradshaw</td>
  576. <td>Director</td>
  577. <td>New York</td>
  578. <td>65</td>
  579. <td>2008/09/26</td>
  580. <td>$645,750</td>
  581. <td>1042</td>
  582. <td>j.bradshaw@datatables.net</td>
  583. </tr>
  584. <tr>
  585. <td></td>
  586. <td>Olivia</td>
  587. <td>Liang</td>
  588. <td>Support Engineer</td>
  589. <td>Singapore</td>
  590. <td>64</td>
  591. <td>2011/02/03</td>
  592. <td>$234,500</td>
  593. <td>2120</td>
  594. <td>o.liang@datatables.net</td>
  595. </tr>
  596. <tr>
  597. <td></td>
  598. <td>Bruno</td>
  599. <td>Nash</td>
  600. <td>Software Engineer</td>
  601. <td>London</td>
  602. <td>38</td>
  603. <td>2011/05/03</td>
  604. <td>$163,500</td>
  605. <td>6222</td>
  606. <td>b.nash@datatables.net</td>
  607. </tr>
  608. <tr>
  609. <td></td>
  610. <td>Sakura</td>
  611. <td>Yamamoto</td>
  612. <td>Support Engineer</td>
  613. <td>Tokyo</td>
  614. <td>37</td>
  615. <td>2009/08/19</td>
  616. <td>$139,575</td>
  617. <td>9383</td>
  618. <td>s.yamamoto@datatables.net</td>
  619. </tr>
  620. <tr>
  621. <td></td>
  622. <td>Thor</td>
  623. <td>Walton</td>
  624. <td>Developer</td>
  625. <td>New York</td>
  626. <td>61</td>
  627. <td>2013/08/11</td>
  628. <td>$98,540</td>
  629. <td>8327</td>
  630. <td>t.walton@datatables.net</td>
  631. </tr>
  632. <tr>
  633. <td></td>
  634. <td>Finn</td>
  635. <td>Camacho</td>
  636. <td>Support Engineer</td>
  637. <td>San Francisco</td>
  638. <td>47</td>
  639. <td>2009/07/07</td>
  640. <td>$87,500</td>
  641. <td>2927</td>
  642. <td>f.camacho@datatables.net</td>
  643. </tr>
  644. <tr>
  645. <td></td>
  646. <td>Serge</td>
  647. <td>Baldwin</td>
  648. <td>Data Coordinator</td>
  649. <td>Singapore</td>
  650. <td>64</td>
  651. <td>2012/04/09</td>
  652. <td>$138,575</td>
  653. <td>8352</td>
  654. <td>s.baldwin@datatables.net</td>
  655. </tr>
  656. <tr>
  657. <td></td>
  658. <td>Zenaida</td>
  659. <td>Frank</td>
  660. <td>Software Engineer</td>
  661. <td>New York</td>
  662. <td>63</td>
  663. <td>2010/01/04</td>
  664. <td>$125,250</td>
  665. <td>7439</td>
  666. <td>z.frank@datatables.net</td>
  667. </tr>
  668. <tr>
  669. <td></td>
  670. <td>Zorita</td>
  671. <td>Serrano</td>
  672. <td>Software Engineer</td>
  673. <td>San Francisco</td>
  674. <td>56</td>
  675. <td>2012/06/01</td>
  676. <td>$115,000</td>
  677. <td>4389</td>
  678. <td>z.serrano@datatables.net</td>
  679. </tr>
  680. <tr>
  681. <td></td>
  682. <td>Jennifer</td>
  683. <td>Acosta</td>
  684. <td>Junior Javascript Developer</td>
  685. <td>Edinburgh</td>
  686. <td>43</td>
  687. <td>2013/02/01</td>
  688. <td>$75,650</td>
  689. <td>3431</td>
  690. <td>j.acosta@datatables.net</td>
  691. </tr>
  692. <tr>
  693. <td></td>
  694. <td>Cara</td>
  695. <td>Stevens</td>
  696. <td>Sales Assistant</td>
  697. <td>New York</td>
  698. <td>46</td>
  699. <td>2011/12/06</td>
  700. <td>$145,600</td>
  701. <td>3990</td>
  702. <td>c.stevens@datatables.net</td>
  703. </tr>
  704. <tr>
  705. <td></td>
  706. <td>Hermione</td>
  707. <td>Butler</td>
  708. <td>Regional Director</td>
  709. <td>London</td>
  710. <td>47</td>
  711. <td>2011/03/21</td>
  712. <td>$356,250</td>
  713. <td>1016</td>
  714. <td>h.butler@datatables.net</td>
  715. </tr>
  716. <tr>
  717. <td></td>
  718. <td>Lael</td>
  719. <td>Greer</td>
  720. <td>Systems Administrator</td>
  721. <td>London</td>
  722. <td>21</td>
  723. <td>2009/02/27</td>
  724. <td>$103,500</td>
  725. <td>6733</td>
  726. <td>l.greer@datatables.net</td>
  727. </tr>
  728. <tr>
  729. <td></td>
  730. <td>Jonas</td>
  731. <td>Alexander</td>
  732. <td>Developer</td>
  733. <td>San Francisco</td>
  734. <td>30</td>
  735. <td>2010/07/14</td>
  736. <td>$86,500</td>
  737. <td>8196</td>
  738. <td>j.alexander@datatables.net</td>
  739. </tr>
  740. <tr>
  741. <td></td>
  742. <td>Shad</td>
  743. <td>Decker</td>
  744. <td>Regional Director</td>
  745. <td>Edinburgh</td>
  746. <td>51</td>
  747. <td>2008/11/13</td>
  748. <td>$183,000</td>
  749. <td>6373</td>
  750. <td>s.decker@datatables.net</td>
  751. </tr>
  752. <tr>
  753. <td></td>
  754. <td>Michael</td>
  755. <td>Bruce</td>
  756. <td>Javascript Developer</td>
  757. <td>Singapore</td>
  758. <td>29</td>
  759. <td>2011/06/27</td>
  760. <td>$183,000</td>
  761. <td>5384</td>
  762. <td>m.bruce@datatables.net</td>
  763. </tr>
  764. <tr>
  765. <td></td>
  766. <td>Donna</td>
  767. <td>Snider</td>
  768. <td>Customer Support</td>
  769. <td>New York</td>
  770. <td>27</td>
  771. <td>2011/01/25</td>
  772. <td>$112,000</td>
  773. <td>4226</td>
  774. <td>d.snider@datatables.net</td>
  775. </tr>
  776. </tbody>
  777. </table>
  778. <ul class="tabs">
  779. <li class="active">Javascript</li>
  780. <li>HTML</li>
  781. <li>CSS</li>
  782. <li>Ajax</li>
  783. <li>Server-side script</li>
  784. </ul>
  785. <div class="tabs">
  786. <div class="js">
  787. <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
  788. var table = $('#example').DataTable( {
  789. scrollY: &quot;300px&quot;,
  790. scrollX: true,
  791. scrollCollapse: true,
  792. paging: false,
  793. columnDefs: [ {
  794. sortable: false,
  795. &quot;class&quot;: &quot;index&quot;,
  796. targets: 0
  797. } ],
  798. order: [[ 1, 'asc' ]]
  799. } );
  800. table.on( 'order.dt search.dt', function () {
  801. table.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
  802. cell.innerHTML = i+1;
  803. } );
  804. } ).draw();
  805. new $.fn.dataTable.FixedColumns( table );
  806. } );</code>
  807. <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
  808. <ul>
  809. <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
  810. <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
  811. <li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
  812. </ul>
  813. </div>
  814. <div class="table">
  815. <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
  816. </div>
  817. <div class="css">
  818. <div>
  819. <p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
  820. additional CSS used is shown below:</p><code class="multiline language-css">/* Ensure that the demo table scrolls */
  821. th, td { white-space: nowrap; }
  822. div.dataTables_wrapper {
  823. width: 800px;
  824. margin: 0 auto;
  825. }
  826. /* Styling for the index columns */
  827. th.index,
  828. td.index {
  829. background-color: white !important;
  830. border-top: 1px solid white !important;
  831. border-bottom: none !important;
  832. }
  833. div.DTFC_LeftHeadWrapper table {
  834. border-bottom: 1px solid white !important;
  835. }
  836. div.DTFC_LeftHeadWrapper th {
  837. border-bottom: 1px solid white !important;
  838. }
  839. div.DTFC_LeftBodyWrapper {
  840. border-right: 1px solid black;
  841. }
  842. div.DTFC_LeftFootWrapper th {
  843. border-top: 1px solid white !important;
  844. }</code>
  845. </div>
  846. <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
  847. <ul>
  848. <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
  849. <li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
  850. </ul>
  851. </div>
  852. <div class="ajax">
  853. <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
  854. loaded.</p>
  855. </div>
  856. <div class="php">
  857. <p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
  858. processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
  859. documentation</a>.</p>
  860. </div>
  861. </div>
  862. </section>
  863. </div>
  864. <section>
  865. <div class="footer">
  866. <div class="gradient"></div>
  867. <div class="liner">
  868. <h2>Other examples</h2>
  869. <div class="toc">
  870. <div class="toc-group">
  871. <h3><a href="./index.html">Examples</a></h3>
  872. <ul class="toc active">
  873. <li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
  874. <li><a href="./simple.html">Basic initialisation</a></li>
  875. <li><a href="./two_columns.html">Multiple fixed columns</a></li>
  876. <li><a href="./right_column.html">Right column only</a></li>
  877. <li><a href="./rowspan.html">Complex headers</a></li>
  878. <li><a href="./colvis.html">ColVis integration</a></li>
  879. <li><a href="./server-side-processing.html">Server-side processing</a></li>
  880. <li><a href="./css_size.html">CSS row sizing</a></li>
  881. <li><a href="./size_fixed.html">Assigned column width</a></li>
  882. <li><a href="./size_fluid.html">Fluid column width</a></li>
  883. <li><a href="./col_filter.html">Individual column filtering</a></li>
  884. <li><a href="./bootstrap.html">Bootstrap</a></li>
  885. <li class="active"><a href="./index_column.html">Index column</a></li>
  886. </ul>
  887. </div>
  888. </div>
  889. <div class="epilogue">
  890. <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
  891. Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a>
  892. which extend the capabilities of DataTables.</p>
  893. <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
  894. DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
  895. </div>
  896. </div>
  897. </div>
  898. </section>
  899. </body>
  900. </html>