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

              
                <div class="table-overflow-scroll">
	<table class="table table--striped table--overflow-scroll">
		<tbody>
			<tr>
				<td><strong>Masculine singular&nbsp; &nbsp;</strong></td>
				<td><strong>Feminine singular</strong></td>
				<td><strong>Masculine plural</strong></td>
				<td><strong>Feminine plural</strong></td>
				<td><strong>English</strong>&nbsp;</td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">roj<strong>o&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</strong></span></td>
				<td><span class="txt--lang-foreign">roj<strong>a</strong></span></td>
				<td><span class="txt--lang-foreign">roj<strong>os</strong></span></td>
				<td><span class="txt--lang-foreign">roj<strong>as</strong></span></td>
				<td><span class="txt--lang-native">red</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">amarill<strong>o</strong></span></td>
				<td><span class="txt--lang-foreign">amarill<strong>a</strong></span></td>
				<td><span class="txt--lang-foreign">amarill<strong>os</strong></span></td>
				<td><span class="txt--lang-foreign">amarill<strong>as</strong></span></td>
				<td><span class="txt--lang-native">yellow</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">negr<strong>o</strong></span></td>
				<td><span class="txt--lang-foreign">negr<strong>a</strong></span></td>
				<td><span class="txt--lang-foreign">negr<strong>os</strong></span></td>
				<td><span class="txt--lang-foreign">negr<strong>as</strong></span></td>
				<td><span class="txt--lang-native">black</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">blanc<strong>o</strong></span></td>
				<td><span class="txt--lang-foreign">blanc<strong>a</strong></span></td>
				<td><span class="txt--lang-foreign">blanc<strong>os</strong></span></td>
				<td><span class="txt--lang-foreign">blanc<strong>as</strong></span></td>
				<td><span class="txt--lang-native">white</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">morad<strong>o</strong></span></td>
				<td><span class="txt--lang-foreign">morad<strong>a</strong></span></td>
				<td><span class="txt--lang-foreign">morad<strong>os</strong></span></td>
				<td><span class="txt--lang-foreign">morad<strong>as</strong></span></td>
				<td><span class="txt--lang-native">purple</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">verde</span></td>
				<td><span class="txt--lang-foreign">verde</span></td>
				<td><span class="txt--lang-foreign">verd<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-foreign">verd<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-native">green</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">azul</span></td>
				<td><span class="txt--lang-foreign">azul</span></td>
				<td><span class="txt--lang-foreign">azul<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-foreign">azul<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-native">blue</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">gris</span></td>
				<td><span class="txt--lang-foreign">gris</span></td>
				<td><span class="txt--lang-foreign">gris<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-foreign">gris<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-native">grey</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">marrón</span></td>
				<td><span class="txt--lang-foreign">marrón</span></td>
				<td><span class="txt--lang-foreign">marron<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-foreign">marron<span class="txt-emphasis--1">es</span></span></td>
				<td><span class="txt--lang-native">brown</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">ros<span class="txt-emphasis--2">a</span></span></td>
				<td><span class="txt--lang-foreign">ros<span class="txt-emphasis--2">a</span></span></td>
				<td>
					<p><span class="txt--lang-foreign">ros<span class="txt-emphasis--2">a</span>/</span></p>
					<p><span class="txt--lang-foreign">ros<span class="txt-emphasis--2">as</span></span></p>
				</td>
				<td>
					<p><span class="txt--lang-foreign">ros<span class="txt-emphasis--2">a</span>/</span></p>
					<p><span class="txt--lang-foreign">ros<span class="txt-emphasis--2">as</span></span></p>
				</td>
				<td><span class="txt--lang-native">pink</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">naranj<span class="txt-emphasis--2">a</span></span></td>
				<td><span class="txt--lang-foreign">naranj<span class="txt-emphasis--2">a</span></span></td>
				<td>
					<p><span class="txt--lang-foreign">naranj<span class="txt-emphasis--2">a</span>/</span></p>
					<p><span class="txt--lang-foreign">naranj<span class="txt-emphasis--2">as</span></span></p>
				</td>
				<td>
					<p><span class="txt--lang-foreign">naranj<span class="txt-emphasis--2">a</span>/</span></p>
					<p><span class="txt--lang-foreign">naranj<span class="txt-emphasis--2">as</span></span></p>
				</td>
				<td><span class="txt--lang-native">orange</span></td>
			</tr>
			<tr>
				<td><span class="txt--lang-foreign">violet<span class="txt-emphasis--2">a</span></span></td>
				<td><span class="txt--lang-foreign">violet<span class="txt-emphasis--2">a</span></span></td>
				<td>
					<p><span class="txt--lang-foreign">violet<span class="txt-emphasis--2">a</span>/</span></p>
					<p><span class="txt--lang-foreign">violet<span class="txt-emphasis--2">as</span></span></p>
				</td>
				<td>
					<p><span class="txt--lang-foreign">violet<span class="txt-emphasis--2">a</span>/</span></p>
					<p><span class="txt--lang-foreign">violet<span class="txt-emphasis--2">as</span></span></p>
				</td>
				<td><span class="txt--lang-native">violet</span></td>
			</tr>
		</tbody>
	</table>
</div>
              
            
!

CSS

              
                @mixin customWebkitScrollbarHorizontal {
	// Custom styles for webkit scrollbar
	// since it is hidden by default,
	// before scrolling happens
	&::-webkit-scrollbar {
		height: 10px;
	}

	&::-webkit-scrollbar-thumb {
		background-color: #abacb0;
		border: 2px solid white;
		border-radius: 5px;
	}

	&::-webkit-scrollbar-track {
		background-color: #fcfcfc;
		border: 1px solid #e5e5e5;
	}

	&::-webkit-scrollbar-thumb,
	&::-webkit-scrollbar-track {
		&:vertical {
			display: none;
		}
	}
}


// Scrolling shadows pure CSS solution based on gradients and background-attachment.
//
// Inspired by:
// https://lea.verou.me/2012/04/background-attachment-local/
// https://dabblet.com/gist/2462915
// ---

.table--overflow-scroll {
	display: block;
	width: 300px;	
	border: 1px solid #d2d2d2;
	color: gray;
	@include customWebkitScrollbarHorizontal;
	-webkit-overflow-scrolling: touch;
	
	// Shadow effect 
	overflow: auto;
	background:
		// Shadow covers 
		linear-gradient(90deg, white 30%, rgba(255,255,255,0)),
		linear-gradient(90deg, rgba(255,255,255,0), white 70%) 0 100%,
		
		// Shadows
		radial-gradient(farthest-side at 0% 50%, rgba(0,0,0, 0.2), white),
		radial-gradient(farthest-side at 100% 50%, rgba(0,0,0, 0.2), white) 0 100%;
	
	background-repeat: no-repeat;
	background-color: white;
	background-position: top left, top right, top left, top right;
	background-size: 40px 100%, 40px 100%, 20px 100%, 20px 100%;
	background-attachment: local, local, scroll, scroll;
	
	// Blend shadows in the background with stripes so shadows are visible on top even though they are below them
	&.table--striped {
		td {
			mix-blend-mode: multiply;
		}
		
		tr {
			&:nth-child(odd) {
				td {
					mix-blend-mode: multiply;
				}
			}	
		}
	}
}


// Generic styles
// --- 

body {
	padding: 50px;
}
.table {
	td {
		padding: 0.5rem 1.5rem;
	}
}
.table--striped {
	tr {
		&:nth-child(odd) {
			td {
				background-color: #f1f1f1;
			}
		}	
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console