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

              
                <body>
<table>
<thead>
<tr><th id="ln1" colspan="3"><div id="nb"></div>Rechercher : <input id="tri" type="text" size="17"/><a href="#" id="bt" onclick="vide()">↺</a></th></tr>
<tr><th id="a"><div id="t2"><b>Trier :</b></div><div id="ct"><div id="f1">▼</div>Nom du service<div id="f2">▼</div></div></th>
<th id="b"><div id="ct"><div id="f1">▼</div>Etat<div id="f2">▼</div></div></th>
<th id="c"><div id="ct"><div id="f1">▼</div>Démarrage conseillé<div id="f2">▼</div></div></th></tr>
</thead>
<tbody id="tb">
<tr><td>Accès du périphérique d'interface utilisateur</td><td></td><td>Désactivé</td></tr>
<tr><td>Acquisition d'image Windows (WIA)</td><td></td><td>Manuel</td></tr>
<tr><td>Agent de protection d’accès réseau</td><td></td><td>Désactivé</td></tr>
<tr><td>Agent de stratégie IPsec</td><td>Démarré</td><td>Manuel</td></tr>
<tr><td>Alimentation</td><td>Démarré</td><td>Automatique</td></tr>
<tr><td>Appel de procédure distante (RPC)</td><td>Démarré</td><td>Automatique</td></tr>
<tr><td>Application Host Helper Service</td><td></td><td>Automatique</td></tr>
<tr><td>Application système COM+</td><td></td><td>Manuel</td></tr>
<tr><td>Assistance IP</td><td></td><td>Désactivé</td></tr>
<tr><td>Assistance NetBIOS sur TCP/IP</td><td></td><td>Désactivé</td></tr>
  </tbody>
</table>
</body>
              
            
!

CSS

              
                * {font-family: "Fira Sans", sans-serif}
input[type='checkbox'] {filter: hue-rotate(20deg)}
table {
	border-collapse: collapse;
	margin: -7px auto
}
th, td, #bt {padding: 2px 4px}
th, #bt {color: #fff}
th {background: #5d625c}
#ln1, #f1 {text-align: right}
#ln1, #t2 {color: #c6c3bd}
#tri, tr:nth-child(odd) {background: #dddad4}
#tri {
	color: blue;
	outline: 0
}
#t2, #nb {position: absolute}
tr {color: #444}
tr:nth-child(even) {background: #c6c3bd}
#bt {
	border-radius: 2px;
	text-decoration: none;
	font-size: 12px;
	background: blue;
	box-shadow: inset 2px 2px 3px #88f, inset -2px -2px 2px #13a;
	margin-left: 2px
}
#bt:active {color: #ff0}
#ct {display: flex}
#f1, #f2 {
	flex: 1;
	font-size: 9px;
	margin-top: 3px
}
#f1 {margin-right: 5px}
#f2 {text-align: left}
#f2, #nb {margin-left: 5px}
#a, #nb {width: 434px}
#nb {
	text-align: center;
	color: lime
}
              
            
!

JS

              
                var clik = 0,
	fleCtr = 1,
	myBox = document.getElementById("tri"),
	nb = document.getElementById("nb");
function test(id) {
	document.getElementById(id).parentElement.parentElement.style.background = "gold";
}
function stylraz(raz) {
	nb.innerHTML = "";
	f0 = document.querySelectorAll("#f1, #f2, #t2");
	for (var a = 0; a <f0.length; a++) {
		f0[a].style.color = "";
		if(raz == 1) {f0[a].innerHTML = f0[a].innerHTML.replaceAll("▲","▼")}
	}
}
//Tri
const compar = (ids, asc) => (row1, row2) => {
	const	tdVal = (row, ids) => row.children[ids].textContent,
			tri = (v1, v2) => v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2);
	return tri(tdVal(asc ? row1 : row2, ids), tdVal(asc ? row2 : row1, ids));
};
const tbody = document.getElementById('tb');
const thx = document.querySelectorAll('#a, #b, #c');
const trx = tbody.querySelectorAll('tr');
thx.forEach(tht => tht.addEventListener('click', () => {
	//Filtrea0
	var p1 = document.querySelectorAll('#z').length;
	for (var b = 1; b <= p1; b++) {
		p2 = document.getElementById('z');
		p2.remove();
	}
	//Filtrea0
	myBox.value="";
	let classe = Array.from(trx).sort(compar(Array.from(thx).indexOf(tht), this.asc = !this.asc));
	//Echap 1er clic colonne 1
	if (clik == 0) {clik=1} else {clik=2}
	idcol = tht.id;
	//Fin - Echap...
	//Style et Flèche
	if (clik != 1 && fleCtr == 1) {
		rech = "▼";
		remp = "▲";
		fleCtr = 2
	} else {
		rech = "▲";
		remp = "▼";
		fleCtr = 1
	}
	tht.innerHTML = tht.innerHTML.replaceAll(rech,remp);
	stylraz(0);
	document.getElementById("t2").style.color = "lime";
	for (var c = 0; c <2; c++) {tht.querySelectorAll("#f1, #f2")[c].style.color = "lime"}
	//Fin Style...
	classe.forEach(tr => tbody.appendChild(tr));
}));
//Tri
//Filtre
ad = '<input type="checkbox" onclick="test(';
for (var d = 1; d <= trx.length; d++) {tbody.querySelector('tr:nth-of-type('+d+') td').insertAdjacentHTML('afterbegin', ad+d+')"id="'+d+'">')}
document.addEventListener('DOMContentLoaded', function () {
	const Tab = document.getElementById('tb');
	let Tab1 = [];
	for (let e = 0; e < Tab.rows.length; e++) {
		Tab1[e] = [];
		const objCells = Tab.rows.item(e).cells;
		for (let f = 0; f < objCells.length; f++) {Tab1[e][f] = objCells.item(f).innerText}
	}
	document.getElementById("tri").addEventListener('input', event => {
		stylraz(1)
		const caseVal = document.getElementById("tri").value;
		if (caseVal != '' || caseVal != 'undefined') {
			Tab.innerHTML = "";
			let Tab2 = [];
			for (let g = 0; g < Tab1.length; g++) {
				z = Tab1[g];
				for (let h = 0; h < 3; h++) {Tab2[h] = z[h].toLowerCase().indexOf(caseVal.toLowerCase())}
				if (Tab2[0] > -1 || Tab2[1] > -1 || Tab2[2] > -1) {Tab.innerHTML += '<tr id="z" ><td>'+ad+g+')"id="'+g+'">'+z[0]+'</td><td>'+z[1]+'</td><td>'+z[2]+'</td></tr>'}
			}
		nb.innerHTML = document.querySelectorAll('#z').length+" résultat(s) trouvé(s)";
		}
	});
});
//Filtre
function vide() {
	var myBoxEven = new Event('input',{bubbles:true,cancelable: true});
	myBox.value="";
	myBox.dispatchEvent(myBoxEven);
	stylraz(1)
}
              
            
!
999px

Console