HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div class="pagination">
<ol id="numbers"></ol>
</div>
<table id="my-table">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Date of Birth</th>
<th>Address</th>
<th>Country</th>
<th>Experience</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Kyle P. Fleming</td>
<td>March 14th, 2019</td>
<td>Ap #838-8378 Pharetra Rd.</td>
<td>Japan</td>
<td>22</td>
</tr>
<tr>
<td>2</td>
<td>Dora S. Valenzuela</td>
<td>May 15th, 2018</td>
<td>457-4255 Velit. Rd.</td>
<td>Lesotho</td>
<td>13</td>
</tr>
<tr>
<td>3</td>
<td>Tara X. Humphrey</td>
<td>May 13th, 2019</td>
<td>P.O. Box 902, 8389 Interdum. Road</td>
<td>Nauru</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>Jade A. Frazier</td>
<td>January 12th, 2020</td>
<td>1883 Metus. Ave</td>
<td>French Polynesia</td>
<td>25</td>
</tr>
<tr>
<td>5</td>
<td>Frances Q. Steele</td>
<td>December 18th, 2018</td>
<td>4139 Senectus Rd.</td>
<td>Trinidad and Tobago</td>
<td>27</td>
</tr>
<tr>
<td>6</td>
<td>Lacota H. Hernandez</td>
<td>July 4th, 2018</td>
<td>610-3617 Tellus St.</td>
<td>Bahamas</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>Blaze I. Mcgee</td>
<td>January 5th, 2020</td>
<td>Ap #996-7968 Mi Avenue</td>
<td>Zambia</td>
<td>20</td>
</tr>
<tr>
<td>8</td>
<td>Carson N. Stevenson</td>
<td>May 6th, 2018</td>
<td>183-5258 Vel, Road</td>
<td>Philippines</td>
<td>5</td>
</tr>
<tr>
<td>9</td>
<td>Rashad V. Perry</td>
<td>July 31st, 2019</td>
<td>Ap #978-7382 Lobortis. St.</td>
<td>Philippines</td>
<td>29</td>
</tr>
<tr>
<td>10</td>
<td>Isabella V. Wright</td>
<td>December 5th, 2018</td>
<td>Ap #142-4168 Augue Road</td>
<td>Italy</td>
<td>3</td>
</tr>
<tr>
<td>11</td>
<td>Xander B. Hoover</td>
<td>July 17th, 2018</td>
<td>6120 Suspendisse Ave</td>
<td>Maldives</td>
<td>21</td>
</tr>
<tr>
<td>12</td>
<td>Mona J. Saunders</td>
<td>December 6th, 2019</td>
<td>Ap #908-2496 Mus. Rd.</td>
<td>Iceland</td>
<td>13</td>
</tr>
<tr>
<td>13</td>
<td>Ralph R. Ingram</td>
<td>September 15th, 2019</td>
<td>788-8864 Fames Street</td>
<td>Netherlands</td>
<td>2</td>
</tr>
<tr>
<td>14</td>
<td>Lewis H. Lane</td>
<td>May 31st, 2019</td>
<td>P.O. Box 377, 9903 Lectus Rd.</td>
<td>Palestine, State of</td>
<td>1</td>
</tr>
<tr>
<td>15</td>
<td>Ivory A. Fowler</td>
<td>March 17th, 2020</td>
<td>Ap #947-9930 Magna. Road</td>
<td>Western Sahara</td>
<td>2</td>
</tr>
<tr>
<td>16</td>
<td>Addison U. Vargas</td>
<td>March 25th, 2019</td>
<td>Ap #554-1800 Ac Avenue</td>
<td>Tunisia</td>
<td>25</td>
</tr>
<tr>
<td>17</td>
<td>Kadeem N. Beard</td>
<td>January 11th, 2020</td>
<td>P.O. Box 929, 5513 Rhoncus Road</td>
<td>Bonaire, Sint Eustatius and Saba</td>
<td>3</td>
</tr>
<tr>
<td>18</td>
<td>Ima G. Mathis</td>
<td>December 24th, 2019</td>
<td>P.O. Box 182, 6197 Nulla. Rd.</td>
<td>American Samoa</td>
<td>27</td>
</tr>
<tr>
<td>19</td>
<td>Armando W. Pickett</td>
<td>April 23rd, 2019</td>
<td>348-3397 Morbi Road</td>
<td>Gabon</td>
<td>23</td>
</tr>
<tr>
<td>20</td>
<td>Aileen K. Molina</td>
<td>November 21st, 2018</td>
<td>612-1791 Auctor St.</td>
<td>Poland</td>
<td>15</td>
</tr>
<tr>
<td>21</td>
<td>Halee U. Sandoval</td>
<td>January 2nd, 2019</td>
<td>P.O. Box 507, 6332 Nec, St.</td>
<td>Germany</td>
<td>25</td>
</tr>
<tr>
<td>22</td>
<td>Julie Y. Wilkinson</td>
<td>October 15th, 2019</td>
<td>158-8182 Non, Av.</td>
<td>Solomon Islands</td>
<td>20</td>
</tr>
<tr>
<td>23</td>
<td>Jillian T. Ellis</td>
<td>March 22nd, 2020</td>
<td>571-4676 Orci, St.</td>
<td>French Guiana</td>
<td>25</td>
</tr>
<tr>
<td>24</td>
<td>Nathan D. Richards</td>
<td>June 11th, 2019</td>
<td>398-6894 Vel Street</td>
<td>French Southern Territories</td>
<td>11</td>
</tr>
<tr>
<td>25</td>
<td>Marvin Y. Rutledge</td>
<td>February 20th, 2019</td>
<td>1661 Tincidunt, Street</td>
<td>Portugal</td>
<td>20</td>
</tr>
<tr>
<td>26</td>
<td>Troy N. Case</td>
<td>April 4th, 2020</td>
<td>P.O. Box 107, 3752 Mattis St.</td>
<td>Denmark</td>
<td>17</td>
</tr>
<tr>
<td>27</td>
<td>Ria D. Perez</td>
<td>March 7th, 2020</td>
<td>9778 Vel, St.</td>
<td>Guinea-Bissau</td>
<td>22</td>
</tr>
<tr>
<td>28</td>
<td>Jeremy P. Marshall</td>
<td>June 4th, 2018</td>
<td>898-5395 Eget Rd.</td>
<td>Angola</td>
<td>6</td>
</tr>
<tr>
<td>29</td>
<td>Asher Q. Guzman</td>
<td>March 19th, 2020</td>
<td>273-6698 Maecenas Street</td>
<td>Guernsey</td>
<td>17</td>
</tr>
<tr>
<td>30</td>
<td>Karly U. Elliott</td>
<td>August 5th, 2018</td>
<td>P.O. Box 189, 9754 Sodales. Street</td>
<td>Mauritania</td>
<td>4</td>
</tr>
<tr>
<td>31</td>
<td>Ifeoma G. Middleton</td>
<td>April 29th, 2018</td>
<td>Ap #263-2773 Eu St.</td>
<td>Iceland</td>
<td>22</td>
</tr>
<tr>
<td>32</td>
<td>Jason V. Finley</td>
<td>May 5th, 2019</td>
<td>790-7225 Mauris Road</td>
<td>Nepal</td>
<td>22</td>
</tr>
<tr>
<td>33</td>
<td>Jordan T. Vang</td>
<td>January 21st, 2020</td>
<td>Ap #752-8233 Orci. Street</td>
<td>Tuvalu</td>
<td>21</td>
</tr>
<tr>
<td>34</td>
<td>Stella D. Molina</td>
<td>May 18th, 2018</td>
<td>P.O. Box 436, 310 Dictum Road</td>
<td>Austria</td>
<td>13</td>
</tr>
<tr>
<td>35</td>
<td>Jenna Z. Reese</td>
<td>April 26th, 2019</td>
<td>9280 Diam St.</td>
<td>United States Minor Outlying Islands</td>
<td>17</td>
</tr>
<tr>
<td>36</td>
<td>Anika R. Whitehead</td>
<td>February 13th, 2020</td>
<td>6696 A St.</td>
<td>Poland</td>
<td>24</td>
</tr>
<tr>
<td>37</td>
<td>Jaden P. May</td>
<td>May 14th, 2018</td>
<td>P.O. Box 801, 788 Ante. Rd.</td>
<td>Cuba</td>
<td>30</td>
</tr>
<tr>
<td>38</td>
<td>Dorian W. Gill</td>
<td>December 26th, 2019</td>
<td>Ap #431-2515 Nec, Avenue</td>
<td>Guadeloupe</td>
<td>10</td>
</tr>
<tr>
<td>39</td>
<td>Xenos Z. Strickland</td>
<td>December 5th, 2019</td>
<td>858-5206 Lobortis Road</td>
<td>Croatia</td>
<td>28</td>
</tr>
<tr>
<td>40</td>
<td>Devin G. Bray</td>
<td>June 6th, 2019</td>
<td>Ap #905-6811 Velit Street</td>
<td>Ghana</td>
<td>6</td>
</tr>
<tr>
<td>41</td>
<td>Maxwell J. Walters</td>
<td>November 15th, 2019</td>
<td>1742 Est Ave</td>
<td>Niger</td>
<td>12</td>
</tr>
<tr>
<td>42</td>
<td>Jacob X. Christian</td>
<td>June 17th, 2018</td>
<td>734-5237 Pharetra Av.</td>
<td>Azerbaijan</td>
<td>8</td>
</tr>
<tr>
<td>43</td>
<td>Ora Q. Roman</td>
<td>June 17th, 2018</td>
<td>5681 Amet Avenue</td>
<td>Bosnia and Herzegovina</td>
<td>3</td>
</tr>
<tr>
<td>44</td>
<td>Ryder Z. Hudson</td>
<td>June 3rd, 2018</td>
<td>3990 Et, Street</td>
<td>Bolivia</td>
<td>27</td>
</tr>
<tr>
<td>45</td>
<td>Tarik N. Robertson</td>
<td>March 14th, 2020</td>
<td>7811 Phasellus Av.</td>
<td>Comoros</td>
<td>2</td>
</tr>
<tr>
<td>46</td>
<td>Zahir I. Rodriguez</td>
<td>February 19th, 2020</td>
<td>5825 Orci. Rd.</td>
<td>Myanmar</td>
<td>5</td>
</tr>
<tr>
<td>47</td>
<td>Orlando D. Maynard</td>
<td>October 27th, 2018</td>
<td>Ap #552-7707 Nunc, Avenue</td>
<td>United Kingdom (Great Britain)</td>
<td>7</td>
</tr>
<tr>
<td>48</td>
<td>Tallulah P. Potts</td>
<td>July 24th, 2019</td>
<td>P.O. Box 384, 6617 Amet, Ave</td>
<td>El Salvador</td>
<td>11</td>
</tr>
<tr>
<td>49</td>
<td>Melodie E. Alvarado</td>
<td>April 8th, 2019</td>
<td>Ap #912-3205 Nec, Road</td>
<td>Anguilla</td>
<td>19</td>
</tr>
<tr>
<td>50</td>
<td>Tate H. Moss</td>
<td>March 2nd, 2019</td>
<td>292-3497 Ut Av.</td>
<td>Grenada</td>
<td>29</td>
</tr>
<tr>
<td>51</td>
<td>Cole H. Ford</td>
<td>December 16th, 2019</td>
<td>6548 Ante. Ave</td>
<td>Norfolk Island</td>
<td>24</td>
</tr>
<tr>
<td>52</td>
<td>Fiona G. Warner</td>
<td>July 11th, 2019</td>
<td>Ap #159-6731 Nunc Av.</td>
<td>Slovenia</td>
<td>26</td>
</tr>
<tr>
<td>53</td>
<td>Blossom V. Cross</td>
<td>July 19th, 2019</td>
<td>7362 Ut Rd.</td>
<td>Fiji</td>
<td>6</td>
</tr>
<tr>
<td>54</td>
<td>Kim M. Willis</td>
<td>November 27th, 2018</td>
<td>512-7725 Et, Avenue</td>
<td>Croatia</td>
<td>10</td>
</tr>
<tr>
<td>55</td>
<td>Samuel R. Holden</td>
<td>September 13th, 2018</td>
<td>Ap #100-2688 Nec, Rd.</td>
<td>Kuwait</td>
<td>11</td>
</tr>
<tr>
<td>56</td>
<td>Winter A. Olson</td>
<td>November 2nd, 2019</td>
<td>3468 Porttitor Road</td>
<td>Korea, South</td>
<td>1</td>
</tr>
<tr>
<td>57</td>
<td>Carolyn C. Page</td>
<td>February 14th, 2019</td>
<td>P.O. Box 223, 6466 Non, Street</td>
<td>Cuba</td>
<td>20</td>
</tr>
<tr>
<td>58</td>
<td>Ayanna Z. Estrada</td>
<td>November 9th, 2018</td>
<td>Ap #378-5104 Ornare. Avenue</td>
<td>Trinidad and Tobago</td>
<td>13</td>
</tr>
<tr>
<td>59</td>
<td>Sydnee V. Coffey</td>
<td>November 9th, 2018</td>
<td>Ap #422-7110 Aenean Avenue</td>
<td>Martinique</td>
<td>25</td>
</tr>
<tr>
<td>60</td>
<td>Ivan C. Hogan</td>
<td>February 15th, 2019</td>
<td>111-6033 Tristique St.</td>
<td>Swaziland</td>
<td>8</td>
</tr>
<tr>
<td>61</td>
<td>Quentin H. Shaw</td>
<td>March 9th, 2020</td>
<td>981-5391 Eu Road</td>
<td>Jamaica</td>
<td>27</td>
</tr>
<tr>
<td>62</td>
<td>Cairo O. Robbins</td>
<td>January 9th, 2020</td>
<td>P.O. Box 923, 7776 Elementum Ave</td>
<td>Israel</td>
<td>12</td>
</tr>
<tr>
<td>63</td>
<td>Ali S. Merritt</td>
<td>November 15th, 2019</td>
<td>P.O. Box 725, 8130 Et, St.</td>
<td>Albania</td>
<td>25</td>
</tr>
<tr>
<td>64</td>
<td>Maia Y. Skinner</td>
<td>March 31st, 2020</td>
<td>8427 Tellus Av.</td>
<td>Zambia</td>
<td>24</td>
</tr>
<tr>
<td>65</td>
<td>Molly M. Tillman</td>
<td>May 8th, 2018</td>
<td>656-5888 Purus, Ave</td>
<td>Guatemala</td>
<td>8</td>
</tr>
<tr>
<td>66</td>
<td>Hector Z. Sampson</td>
<td>July 10th, 2019</td>
<td>Ap #267-8567 Nam Rd.</td>
<td>Cook Islands</td>
<td>19</td>
</tr>
<tr>
<td>67</td>
<td>Lois G. Doyle</td>
<td>November 11th, 2019</td>
<td>6820 Eleifend. Rd.</td>
<td>Bangladesh</td>
<td>22</td>
</tr>
<tr>
<td>68</td>
<td>Noble H. Mcfadden</td>
<td>March 27th, 2019</td>
<td>404-2032 Nulla Street</td>
<td>Liberia</td>
<td>4</td>
</tr>
<tr>
<td>69</td>
<td>Elliott Q. Underwood</td>
<td>August 25th, 2019</td>
<td>Ap #122-3393 Pede, Av.</td>
<td>Dominican Republic</td>
<td>18</td>
</tr>
<tr>
<td>70</td>
<td>Dahlia P. Monroe</td>
<td>August 22nd, 2018</td>
<td>911-4495 Tincidunt St.</td>
<td>Angola</td>
<td>1</td>
</tr>
<tr>
<td>71</td>
<td>Orla Y. Morton</td>
<td>June 22nd, 2018</td>
<td>Ap #982-5169 In Rd.</td>
<td>Netherlands</td>
<td>12</td>
</tr>
<tr>
<td>72</td>
<td>Felix D. Clayton</td>
<td>October 19th, 2018</td>
<td>830-428 Lectus St.</td>
<td>Poland</td>
<td>29</td>
</tr>
<tr>
<td>73</td>
<td>Christine U. Richardson</td>
<td>July 22nd, 2019</td>
<td>Ap #788-8973 A, St.</td>
<td>Brunei</td>
<td>9</td>
</tr>
<tr>
<td>74</td>
<td>Indigo U. Skinner</td>
<td>June 28th, 2018</td>
<td>P.O. Box 848, 7418 Dolor. St.</td>
<td>Bosnia and Herzegovina</td>
<td>3</td>
</tr>
<tr>
<td>75</td>
<td>Kareem T. Beach</td>
<td>December 23rd, 2019</td>
<td>Ap #690-7821 Arcu Ave</td>
<td>Kazakhstan</td>
<td>24</td>
</tr>
<tr>
<td>76</td>
<td>Jeremy S. Winters</td>
<td>November 10th, 2019</td>
<td>7316 Hymenaeos. Road</td>
<td>Macedonia</td>
<td>3</td>
</tr>
<tr>
<td>77</td>
<td>Zachary V. Galloway</td>
<td>July 9th, 2019</td>
<td>P.O. Box 314, 6784 At St.</td>
<td>Cocos (Keeling) Islands</td>
<td>12</td>
</tr>
<tr>
<td>78</td>
<td>Lila G. Daugherty</td>
<td>February 8th, 2019</td>
<td>P.O. Box 909, 9321 Sem Rd.</td>
<td>Bermuda</td>
<td>19</td>
</tr>
<tr>
<td>79</td>
<td>Harlan P. Nielsen</td>
<td>December 18th, 2018</td>
<td>101-477 Felis. Street</td>
<td>Turkey</td>
<td>18</td>
</tr>
<tr>
<td>80</td>
<td>Daria A. Keller</td>
<td>December 10th, 2018</td>
<td>Ap #646-3875 Consequat Ave</td>
<td>Cape Verde</td>
<td>19</td>
</tr>
<tr>
<td>81</td>
<td>Reuben S. Schwartz</td>
<td>June 3rd, 2018</td>
<td>500-9895 Cum Rd.</td>
<td>Austria</td>
<td>15</td>
</tr>
<tr>
<td>82</td>
<td>Alan M. Neal</td>
<td>October 17th, 2018</td>
<td>P.O. Box 325, 9553 Morbi Av.</td>
<td>Northern Mariana Islands</td>
<td>17</td>
</tr>
<tr>
<td>83</td>
<td>Plato J. Stevens</td>
<td>June 20th, 2019</td>
<td>Ap #368-6173 Ac, Rd.</td>
<td>Madagascar</td>
<td>25</td>
</tr>
<tr>
<td>84</td>
<td>Natalie O. Moreno</td>
<td>January 6th, 2020</td>
<td>Ap #558-609 Bibendum St.</td>
<td>Cameroon</td>
<td>2</td>
</tr>
<tr>
<td>85</td>
<td>Gray I. Wagner</td>
<td>August 14th, 2019</td>
<td>3501 Nullam Ave</td>
<td>Saint Martin</td>
<td>13</td>
</tr>
<tr>
<td>86</td>
<td>Buffy U. Ramsey</td>
<td>February 29th, 2020</td>
<td>Ap #804-9624 Tempus Avenue</td>
<td>French Southern Territories</td>
<td>14</td>
</tr>
<tr>
<td>87</td>
<td>Lionel J. Jimenez</td>
<td>August 17th, 2019</td>
<td>781-5154 Phasellus Rd.</td>
<td>Norway</td>
<td>2</td>
</tr>
<tr>
<td>88</td>
<td>Igor B. Perkins</td>
<td>October 26th, 2018</td>
<td>600 Interdum. Rd.</td>
<td>Åland Islands</td>
<td>24</td>
</tr>
<tr>
<td>89</td>
<td>Ishmael L. Hunt</td>
<td>October 23rd, 2019</td>
<td>164 Cursus Av.</td>
<td>Antarctica</td>
<td>20</td>
</tr>
<tr>
<td>90</td>
<td>Omar S. Gonzales</td>
<td>June 28th, 2019</td>
<td>853-8407 Molestie St.</td>
<td>Russian Federation</td>
<td>11</td>
</tr>
<tr>
<td>91</td>
<td>Geraldine V. Hurst</td>
<td>June 27th, 2018</td>
<td>890-1705 Cursus Rd.</td>
<td>Jordan</td>
<td>7</td>
</tr>
<tr>
<td>92</td>
<td>Coby J. Berry</td>
<td>December 9th, 2019</td>
<td>Ap #791-9763 Interdum Street</td>
<td>Saint Lucia</td>
<td>10</td>
</tr>
<tr>
<td>93</td>
<td>Shad W. Rhodes</td>
<td>July 7th, 2019</td>
<td>203-7759 Pellentesque Ave</td>
<td>Kazakhstan</td>
<td>28</td>
</tr>
<tr>
<td>94</td>
<td>Adam Q. Bryant</td>
<td>January 1st, 2019</td>
<td>5027 Metus St.</td>
<td>Sri Lanka</td>
<td>5</td>
</tr>
<tr>
<td>95</td>
<td>Erica T. Jones</td>
<td>August 30th, 2019</td>
<td>465-2467 Elementum St.</td>
<td>Switzerland</td>
<td>2</td>
</tr>
<tr>
<td>96</td>
<td>Maile G. Morrow</td>
<td>August 1st, 2019</td>
<td>511-8299 Eu St.</td>
<td>Croatia</td>
<td>1</td>
</tr>
<tr>
<td>97</td>
<td>Risa Q. Jennings</td>
<td>July 29th, 2018</td>
<td>5160 Mollis St.</td>
<td>American Samoa</td>
<td>2</td>
</tr>
<tr>
<td>98</td>
<td>Herman X. Chase</td>
<td>August 20th, 2019</td>
<td>Ap #225-5269 Dolor Road</td>
<td>Greece</td>
<td>6</td>
</tr>
<tr>
<td>99</td>
<td>Zachery G. Rowland</td>
<td>April 9th, 2020</td>
<td>Ap #557-1990 Nisi Av.</td>
<td>Hungary</td>
<td>7</td>
</tr>
<tr>
<td>100</td>
<td>Kerry A. Guerra</td>
<td>August 6th, 2019</td>
<td>Ap #830-7198 Rhoncus. Rd.</td>
<td>South Africa</td>
<td>22</td>
</tr>
</tbody>
</table>
/* Table styles. */
td,
th {
text-align: left;
padding: .5rem 1rem;
}
tbody tr:nth-child(odd) {
background-color: #ccc;
}
th {
background: #444;
color: #fff;
}
/* Pagination. */
.pagination {
background: #333;
padding: 1rem;
margin-bottom: 1rem;
text-align: center;
display: flex;
justify-content: center;
}
#numbers {
padding: 0;
margin: 0 2rem;
list-style-type: none;
display: flex;
}
#numbers li a {
color: #fff;
padding: .5rem 1rem;
text-decoration: none;
opacity: .7;
}
#numbers li a:hover {
opacity: 1;
}
#numbers li a.active {
opacity: 1;
background: #fff;
color: #333;
}
$(function() {
const rowsPerPage = 13;
const rows = $('#my-table tbody tr');
const rowsCount = rows.length;
const pageCount = Math.ceil(rowsCount / rowsPerPage); // avoid decimals
const numbers = $('#numbers');
// Generate the pagination.
for (var i = 0; i < pageCount; i++) {
numbers.append('<li><a href="#">' + (i+1) + '</a></li>');
}
// Mark the first page link as active.
$('#numbers li:first-child a').addClass('active');
// Display the first set of rows.
displayRows(1);
// On pagination click.
$('#numbers li a').click(function(e) {
var $this = $(this);
e.preventDefault();
// Remove the active class from the links.
$('#numbers li a').removeClass('active');
// Add the active class to the current link.
$this.addClass('active');
// Show the rows corresponding to the clicked page ID.
displayRows($this.text());
});
// Function that displays rows for a specific page.
function displayRows(index) {
var start = (index - 1) * rowsPerPage;
var end = start + rowsPerPage;
// Hide all rows.
rows.hide();
// Show the proper rows for this page.
rows.slice(start, end).show();
}
});
Also see: Tab Triggers