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.
<table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Category</th>
<th>Price</th>
<th>Calories</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<!-- Row 1 -->
<tr>
<td>1</td>
<td>Pizza</td>
<td>Italian</td>
<td>12.99</td>
<td>800</td>
<td>Classic Margherita</td>
</tr>
<!-- Row 2 -->
<tr>
<td>2</td>
<td>Burger</td>
<td>American</td>
<td>8.99</td>
<td>600</td>
<td>Cheeseburger with fries</td>
</tr>
<!-- Row 3 -->
<tr>
<td>3</td>
<td>Sushi</td>
<td>Japanese</td>
<td>22.99</td>
<td>500</td>
<td>Assorted sushi rolls</td>
</tr>
<!-- Row 4 -->
<tr>
<td>4</td>
<td>Tacos</td>
<td>Mexican</td>
<td>10.50</td>
<td>450</td>
<td>Beef and chicken tacos</td>
</tr>
<!-- Row 5 -->
<tr>
<td>5</td>
<td>Salad</td>
<td>Healthy</td>
<td>7.99</td>
<td>300</td>
<td>Fresh garden salad</td>
</tr>
<!-- Row 6 -->
<tr>
<td>6</td>
<td>Pasta</td>
<td>Italian</td>
<td>14.50</td>
<td>700</td>
<td>Spaghetti Bolognese</td>
</tr>
<!-- Row 7 -->
<tr>
<td>7</td>
<td>Chicken Curry</td>
<td>Indian</td>
<td>12.99</td>
<td>550</td>
<td>Authentic Indian curry</td>
</tr>
<!-- Row 8 -->
<tr>
<td>8</td>
<td>Sandwich</td>
<td>American</td>
<td>6.99</td>
<td>400</td>
<td>Club sandwich</td>
</tr>
<!-- Row 9 -->
<tr>
<td>9</td>
<td>Sushi Bowl</td>
<td>Japanese</td>
<td>18.99</td>
<td>600</td>
<td>Chirashi bowl</td>
</tr>
<!-- Row 10 -->
<tr>
<td>10</td>
<td>Shrimp Scampi</td>
<td>Italian</td>
<td>16.99</td>
<td>550</td>
<td>Garlic butter shrimp pasta</td>
</tr>
<!-- Row 11 -->
<tr>
<td>11</td>
<td>Fish and Chips</td>
<td>British</td>
<td>13.50</td>
<td>700</td>
<td>Classic British dish</td>
</tr>
<!-- Row 12 -->
<tr>
<td>12</td>
<td>Ramen</td>
<td>Japanese</td>
<td>11.99</td>
<td>500</td>
<td>Tonkotsu ramen</td>
</tr>
<!-- Row 13 -->
<tr>
<td>13</td>
<td>Caesar Salad</td>
<td>Healthy</td>
<td>8.50</td>
<td>350</td>
<td>Classic Caesar salad</td>
</tr>
<!-- Row 14 -->
<tr>
<td>14</td>
<td>Steak</td>
<td>American</td>
<td>25.99</td>
<td>800</td>
<td>Grilled sirloin steak</td>
</tr>
<!-- Row 15 -->
<tr>
<td>15</td>
<td>Pho</td>
<td>Vietnamese</td>
<td>10.99</td>
<td>450</td>
<td>Beef pho</td>
</tr>
<!-- Row 16 -->
<tr>
<td>16</td>
<td>Lasagna</td>
<td>Italian</td>
<td>16.50</td>
<td>700</td>
<td>Homemade meat lasagna</td>
</tr>
<!-- Row 17 -->
<tr>
<td>17</td>
<td>Fajitas</td>
<td>Mexican</td>
<td>14.99</td>
<td>600</td>
<td>Chicken and beef fajitas</td>
</tr>
<!-- Row 18 -->
<tr>
<td>18</td>
<td>Caprese Salad</td>
<td>Italian</td>
<td>9.99</td>
<td>350</td>
<td>Tomato, mozzarella, and basil</td>
</tr>
<!-- Row 19 -->
<tr>
<td>19</td>
<td>Pad Thai</td>
<td>Thai</td>
<td>12.50</td>
<td>500</td>
<td>Traditional Pad Thai</td>
</tr>
<!-- Row 20 -->
<tr>
<td>20</td>
<td>Chicken Alfredo</td>
<td>Italian</td>
<td>15.99</td>
<td>600</td>
<td>Creamy chicken Alfredo pasta</td>
</tr>
<!-- Row 21 -->
<tr>
<td>21</td>
<td>Vegetable Stir Fry</td>
<td>Chinese</td>
<td>11.50</td>
<td>400</td>
<td>Assorted vegetables stir-fried</td>
</tr>
<!-- Row 22 -->
<tr>
<td>22</td>
<td>Quinoa Bowl</td>
<td>Healthy</td>
<td>9.99</td>
<td>350</td>
<td>Quinoa with mixed vegetables</td>
</tr>
<!-- Row 23 -->
<tr>
<td>23</td>
<td>Tom Yum Soup</td>
<td>Thai</td>
<td>8.50</td>
<td>250</td>
<td>Spicy and sour soup with shrimp</td>
</tr>
<!-- Row 24 -->
<tr>
<td>24</td>
<td>Bruschetta</td>
<td>Italian</td>
<td>7.99</td>
<td>300</td>
<td>Tomato and basil bruschetta</td>
</tr>
<!-- Row 25 -->
<tr>
<td>25</td>
<td>Teriyaki Salmon</td>
<td>Japanese</td>
<td>18.50</td>
<td>600</td>
<td>Grilled teriyaki-glazed salmon</td>
</tr>
<!-- Row 26 -->
<tr>
<td>26</td>
<td>Chicken Shawarma</td>
<td>Middle Eastern</td>
<td>10.99</td>
<td>500</td>
<td>Marinated and grilled chicken</td>
</tr>
<!-- Row 27 -->
<tr>
<td>27</td>
<td>Cheese Platter</td>
<td>Appetizer</td>
<td>14.99</td>
<td>400</td>
<td>Assorted cheeses with crackers</td>
</tr>
<!-- Row 28 -->
<tr>
<td>28</td>
<td>Mango Sticky Rice</td>
<td>Thai</td>
<td>6.50</td>
<td>300</td>
<td>Sweet mango with sticky rice</td>
</tr>
<!-- Row 29 -->
<tr>
<td>29</td>
<td>Spinach Artichoke Dip</td>
<td>Appetizer</td>
<td>8.99</td>
<td>350</td>
<td>Creamy spinach and artichoke dip</td>
</tr>
<!-- Row 30 -->
<tr>
<td>30</td>
<td>Cherry Cheesecake</td>
<td>Dessert</td>
<td>7.50</td>
<td>450</td>
<td>Classic cherry-topped cheesecake</td>
</tr>
<!-- Row 31 -->
<tr>
<td>31</td>
<td>Chicken Enchiladas</td>
<td>Mexican</td>
<td>12.99</td>
<td>550</td>
<td>Shredded chicken enchiladas</td>
</tr>
<!-- Row 32 -->
<tr>
<td>32</td>
<td>Beef Stroganoff</td>
<td>Russian</td>
<td>15.50</td>
<td>650</td>
<td>Creamy beef stroganoff with mushrooms</td>
</tr>
<!-- Row 33 -->
<tr>
<td>33</td>
<td>Chicken Caesar Wrap</td>
<td>American</td>
<td>9.50</td>
<td>400</td>
<td>Grilled chicken in a Caesar wrap</td>
</tr>
<!-- Row 34 -->
<tr>
<td>34</td>
<td>Avocado Toast</td>
<td>Healthy</td>
<td>6.99</td>
<td>350</td>
<td>Sliced avocado on toasted bread</td>
</tr>
<!-- Row 35 -->
<tr>
<td>35</td>
<td>Lemon Garlic Shrimp</td>
<td>Seafood</td>
<td>16.99</td>
<td>500</td>
<td>Grilled shrimp with lemon and garlic</td>
</tr>
<!-- Row 36 -->
<tr>
<td>36</td>
<td>Tomato Basil Soup</td>
<td>Soup</td>
<td>7.50</td>
<td>300</td>
<td>Homemade tomato basil soup</td>
</tr>
<!-- Row 37 -->
<tr>
<td>37</td>
<td>Cajun Jambalaya</td>
<td>Cajun</td>
<td>14.50</td>
<td>600</td>
<td>Spicy Cajun rice dish with meat and vegetables</td>
</tr>
<!-- Row 38 -->
<tr>
<td>38</td>
<td>Chocolate Fondue</td>
<td>Dessert</td>
<td>11.99</td>
<td>450</td>
<td>Assorted fruits dipped in chocolate</td>
</tr>
<!-- Row 39 -->
<tr>
<td>39</td>
<td>Eggplant Parmesan</td>
<td>Italian</td>
<td>13.99</td>
<td>550</td>
<td>Baked eggplant with marinara and cheese</td>
</tr>
<!-- Row 40 -->
<tr>
<td>40</td>
<td>Chicken Noodle Soup</td>
<td>Soup</td>
<td>8.50</td>
<td>350</td>
<td>Classic chicken noodle soup</td>
</tr>
</tbody>
</table>
table {
border: 1px solid;
border-collapse: collapse;
font-family: sans-serif;
max-width: 100%;
margin: 0 auto;
}
thead {
background: black;
color: white;
position: sticky;
text-align: left;
top: 0;
}
tbody tr {
border-bottom: 1px solid;
}
th,td {
padding: 6px 12px;
}
td:nth-of-type(6),th:nth-of-type(6) {
padding-left: 40px;
}
td:nth-of-type(4),th:nth-of-type(4),
td:nth-of-type(5),th:nth-of-type(5){
text-align: right;
}
tr:nth-of-type(even) {
background: #eee;
}
Also see: Tab Triggers