Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource


Add Packages

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.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <h1>Best-selling music artists</h1>

        <th>Period active</th>
        <th>Release year of first charted record</th>
        <th>Total certified units</th>
        <th>Claimed sales</th>
        <td>The Beatles</td>
        <td>United Kingdom</td>
        <td>Rock, Pop</td>
        <td>278.4 million</td>
        <td>600 million</td>
        <td>Elvis Presley</td>
        <td>United States</td>
        <td>Rock and roll, Pop, Country</td>
        <td>225.2 million</td>
        <td>600 million</td>
        <td>Michael Jackson</td>
        <td>United States</td>
        <td>Pop, Rock, Dance, Soul, R&B</td>
        <td>231.8 million</td>
        <td>350 million</td>
        <td>Elton John</td>
        <td>United Kingdom</td>
        <td>Pop, Rock</td>
        <td>186.4 million</td>
        <td>300 million</td>
        <td>United States</td>
        <td>Pop, Dance, Electronica</td>
        <td>173.6 million</td>
        <td>300 million</td>

    <small>Tabular data from <a href="">Wikipedia</a></small>


                table {
  border-collapse: collapse;

th, td {
  padding: .5rem;
  border: 1px solid #999;
  text-align: left;


                // Get the closest common ancestor of the `td` elements
var $tbody = $("tbody");

// Change the background color of an element
function changeBackgroundColor(element, color) {
  $(element).css("backgroundColor", color);

// When a `td` element is clicked,
// change its background color to light blue
$tbody.on("click", "td", function(event) {
  changeBackgroundColor(, "lightblue");