Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <button type="button" aria-controls="myTable" aria-expanded="false" hidden="">expand/collapse</button>
<table id="myTable" typeof="MusicGroup" vocab="http://schema.org/">
	<caption><span property="name">Bruce Springsteen</span>’s studio albums</caption>
	<thead>
		<tr>
			<th>title</th>
			<th>release date</th>
		</tr>
	</thead>
	<tbody>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Greetings from Asbury Park, N.J.</td>
			<td><time property="datePublished">1973-01-05</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">The Wild, the Innocent &amp; the E Street Shuffle</td>
			<td><time property="datePublished">1973-09-11</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Born to Run</td>
			<td><time property="datePublished">1975-08-25</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Darkness on the Edge of Town</td>
			<td><time property="datePublished">1978-06-02</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">The River</td>
			<td><time property="datePublished">1980-10-10</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Nebraska</td>
			<td><time property="datePublished">1982-09-20</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Born in the U.S.A.</td>
			<td><time property="datePublished">1984-06-04</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Tunnel of Love</td>
			<td><time property="datePublished">1987-10-09</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Human Touch</td>
			<td><time property="datePublished">1992-03-31</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Lucky Town</td>
			<td><time property="datePublished">1992-03-31</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">The Ghost of Tom Joad</td>
			<td><time property="datePublished">1995-11-21</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">The Rising</td>
			<td><time property="datePublished">2002-07-30</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Devils &amp; Dust</td>
			<td><time property="datePublished">2005-04-26</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">We Shall Overcome: The Seeger Sessions</td>
			<td><time property="datePublished">2006-04-25</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Magic</td>
			<td><time property="datePublished">2007-09-25</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Working on a Dream</td>
			<td><time property="datePublished">2009-01-27</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Wrecking Ball</td>
			<td><time property="datePublished">2012-03-06</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">High Hopes</td>
			<td><time property="datePublished">2014-01-14</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Western Stars</td>
			<td><time property="datePublished">2019-06-14</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Letter to You</td>
			<td><time property="datePublished">2020-10-23</time></td>
		</tr>
		<tr property="album" typeof="MusicAlbum">
			<td property="name">Only the Strong Survive</td>
			<td><time property="datePublished">2022-11-11</time></td>
		</tr>
	</tbody>
</table>

              
            
!

CSS

              
                html
{
	font: 1.25em Calibri, sans-serif;
}

#myTable
{
	border-collapse: collapse;
	margin-bottom: 2em;
}

#myTable caption, th, td
{
	padding: 0.25rem;
	text-align: left;
}

#myTable th, td
{
	border: thin solid hsl(0, 0%, 50%);
	vertical-align: top;
}

#myTable th
{
	background: hsl(0, 0%, 90%);
}

[aria-expanded='false'] + #myTable > tbody > tr:nth-of-type(n+4)
{
	display: none;
}

[aria-expanded='false'] + #myTable
{
	border-bottom: thick double hsl(0, 0%, 60%);
}

              
            
!

JS

              
                const myTableControlElement = document.querySelector('button[aria-controls="myTable"]');

myTableControlElement.removeAttribute('hidden');

myTableControlElement.addEventListener('click', function () { toggleAriaExpandedAttribute(this); });

function toggleAriaExpandedAttribute(element)
{
	element.setAttribute('aria-expanded', element.getAttribute('aria-expanded') == 'true' ? 'false' : 'true');
}


              
            
!
999px

Console