Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

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.

HTML

              
                <p>CSSWG <a href="https://github.com/w3c/csswg-drafts/issues/865#issuecomment-350585274" target="_parent" rel="noreferrer"><strong>issue #865</strong> (comment)</a></p>

<p>Mauris egestas lacinia lacinia. Cras in diam in nisl auctor suscipit. Fusce maximus quam nec ante commodo commodo. Maecenas condimentum arcu faucibus leo sollicitudin accumsan. Integer dictum tempor metus. In vitae porta nisl. Praesent ullamcorper faucibus mi, nec mattis libero auctor non. Duis volutpat leo non ornare aliquam. Curabitur non varius nisi. Aliquam blandit lorem dui, nec dictum ligula consequat ac. Quisque quis nunc dolor. In interdum purus nibh. Donec congue vulputate ornare.</p>

<div class="table-wrapper">
	<table>
		<tr>
			<th>Donec faucibus</th>
			<th>Proin ante</th>
			<th>Mauris</th>
		</tr>
		<tr>
			<td>lacinia&nbsp;sem&nbsp;vestibulum&nbsp;consectetur&nbsp;lacus</td>
			<td>phasellus&nbsp;eu&nbsp;semper&nbsp;nibh</td>
			<td>nulla&nbsp;elementum&nbsp;viverra&nbsp;malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
		<tr>
			<td>lacinia sem vestibulum, consectetur lacus</td>
			<td>phasellus eu semper nibh</td>
			<td>nulla elementum viverra malesuada</td>
		</tr>
	</table>
</div>
<p>
	<label><input type="checkbox" checked/> Horizontally scrollable</label>
</p>

<p>Donec faucibus volutpat eros eget dignissim. Mauris lorem sem, dapibus sit amet molestie quis, ultricies sed erat. Fusce ut velit sit amet odio ornare tempor id non leo. Pellentesque euismod mattis metus, ac feugiat urna elementum non. Curabitur in dui vitae elit vulputate sagittis non at lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam ligula orci, rutrum in lorem eu, vehicula dictum diam. Duis semper at urna at mattis. Donec molestie auctor enim. Nullam sem est, egestas vel iaculis eleifend, ornare sed felis. Suspendisse potenti. Nunc a velit non tellus laoreet porta at id nibh. Proin vehicula bibendum lorem vel pretium.</p>
<p>Vivamus in lectus vel purus rhoncus ornare. Fusce pulvinar vehicula velit, vel hendrerit odio iaculis ut. Nunc malesuada est ac erat egestas mattis. Duis consequat ut mauris eget lobortis. In quam ipsum, ultrices at enim nec, hendrerit tincidunt magna. Cras nec neque ut neque facilisis consectetur. Nunc sit amet pulvinar justo, ac venenatis purus. Maecenas congue nisi sit amet nisi lacinia eleifend. Quisque convallis ex in mauris efficitur, in convallis risus rutrum.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed cursus ex rutrum est tempor, in facilisis massa pulvinar. Proin sit amet consequat dolor, non consequat purus. Aenean pellentesque viverra libero, bibendum dictum arcu facilisis convallis. Fusce molestie tempus neque vitae sodales. Aliquam suscipit convallis ultricies. Proin volutpat magna orci, condimentum dictum nisl cursus ut. Quisque at lectus eget sem semper molestie eget id libero.</p>
<p>Proin sed ante ornare, lacinia sem vestibulum, consectetur lacus. Phasellus eu semper nibh, at lacinia sapien. Nulla elementum viverra malesuada. Aliquam sodales vestibulum auctor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent maximus mi tincidunt, ultricies nisl sit amet, fermentum est. Etiam sollicitudin suscipit mauris, vitae euismod sem mollis sit amet. Donec in mattis justo.</p>
<p>Mauris egestas lacinia lacinia. Cras in diam in nisl auctor suscipit. Fusce maximus quam nec ante commodo commodo. Maecenas condimentum arcu faucibus leo sollicitudin accumsan. Integer dictum tempor metus. In vitae porta nisl. Praesent ullamcorper faucibus mi, nec mattis libero auctor non. Duis volutpat leo non ornare aliquam. Curabitur non varius nisi. Aliquam blandit lorem dui, nec dictum ligula consequat ac. Quisque quis nunc dolor. In interdum purus nibh. Donec congue vulputate ornare.</p>

              
            
!

CSS

              
                .table-wrapper {
	overflow-x: auto;
}

th {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
}


/* Unrelated */

html {
	font: 110%/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	background: black;
}

body {
	max-width: 35rem;
	padding: 1rem;
	margin: 0 auto;
	background: white;
}

p {
	margin: 1rem 0;
}

a {
	color: blue;
}

table {
	line-height: 1.3;
	border-collapse: collapse;
	background: white;
	outline: 1px solid white;
}

th, td {
	padding: 0.5em 1em;
	border: 1px solid black;
}

th {
	text-align: left;
	background: #eee;
}

label {
	display: flex;
	align-items: center;
	padding: 0.5em 0.5em;
	border: 2px dashed blue;
	border-radius: 0.3em;
}
label:hover {
	background: hsl(240,100%,97%);
}

input {
	margin-right: 0.5rem;
}

              
            
!

JS

              
                'use strict';

const checkbox = document.querySelector('input');
const wrapper = document.querySelector('.table-wrapper');

checkbox.addEventListener('change', () => {
	wrapper.classList.toggle('table-wrapper', this.checked);
});

              
            
!
999px

Console