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.


Auto Save

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.


                 <table id="demotable">
    <h2>Zelda Shrines</h2>
      <th contenteditable>Shrine Name</th>
      <th contenteditable>Region</th>
      <th contenteditable>Description</th>
      <th contenteditable>Difficulty</th>
      <th colspan=4>
        <button id="addbtn" style="view-transition-name: addrow-btn">
          <svg viewBox="0 0 24 24" stroke="currentColor"> 
            <path fill="none" stroke="currentColor" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
          Add Shrine</button>
  <tbody id="tbody">
    <tr style="view-transition-name: ukouh"> 
      <td contenteditable>Ukouh</td>
      <td contenteditable>Great Sky Island</td>
      <td contenteditable>A simple shrine that introduces the player to the basic mechanics of the game.</td>
      <td contenteditable>Easy</td>
    <tr style="view-transition-name: in-isa">
      <td contenteditable>In-isa</td>
      <td contenteditable>Great Sky Island</td>
      <td contenteditable>A shrine that requires the player to solve a simple puzzle involving moving blocks.</td>
      <td contenteditable>Easy</td>
    <tr style="view-transition-name: kamizun">
      <td contenteditable>Kamizun</td>
      <td contenteditable>Hyrule Field</td>
      <td contenteditable>A shrine that requires the player to use their runes to solve a puzzle.</td>
      <td contenteditable>Medium</td>
    <tr style="view-transition-name: tadarok">
      <td contenteditable>Tadarok</td>
      <td contenteditable>Hyrule Field</td>
      <td contenteditable>A shrine that requires the player to use their runes to solve a series of puzzles.</td>
      <td contenteditable>Hard</td>

<p style="view-transition-name: prompt"><kbd>Double click</kbd> to delete a row</p>


                @import "" layer(design.system);
@import "" layer(;
@import "" layer(;

@layer demo {
  table {
    view-transition-name: ttable;
    & thead { view-transition-name: thead }
    & tfoot { view-transition-name: tfoot }
    & caption { view-transition-name: tcaption }
    /* inline row view-transition names so they're attached to 
       the node and not it's DOM position */
  @keyframes squish-v {
    to { transform: scaleY(0) }
  /* custom row entrance/exit */
  ::view-transition-old(tadarok):only-child {
    animation-name: squish-v;
  /* fixes gray background ghost stretch */
  ::view-transition-new(ttable) {
    height: 100%;
    width: 100%;

@layer {
  body {
    display: grid;
    place-content: center;
    place-items: center;
    padding: var(--size-5);
    gap: var(--size-5);


                // handle double click to delete
demotable.ondblclick = e => {
  if ( !== 'TD') return
  let row ='tr')
  function mutate() {
    ? document.startViewTransition(mutate)
    : mutate()

// handle add new row
let base = 1
  , columns = Array.from(Array(4))

addbtn.onclick = e => {
  let newrow = `
    <tr style="view-transition-name: new-row-${base++}">
      ${ =>
        `<td contenteditable>&nbsp;</td>`).join('')
  function mutate() {
    tbody.insertAdjacentHTML('beforeend', newrow)
    ? document.startViewTransition(mutate)
    : mutate()