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

              
                <table class="order-table table tab1">
<thead>
<tr><th id="lign1" colspan="3">Rechercher : <input id="tri" type="text" data-table="order-table" size="17" /><a href="#" class="button" onclick="recharge()">↺</a></th></tr>
<tr><th id="a">
<div id="div1"><b>Trier :</b></div>
<div class="cont"><div class="f1">▼</div>Nom du service<div class="f2">▼</div></div>
</th>
<th id="b">
<div class="cont"><div class="f1">▼</div>Etat<div class="f2">▼</div></div>
</th>
<th id="c">
<div class="cont"><div class="f1">▼</div>Démarrage conseillé<div class="f2">▼</div></div>
</th>
</tr>
</thead>
<tbody id="tbody1">
<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>
<tr><td>Audio Windows</td><td>Démarré</td><td>Automatique</td></tr>
</tbody>
</table>
              
            
!

CSS

              
                * {font-family: "Fira Sans", sans-serif;}
table {
	border-collapse: collapse;
	margin:auto;
}
th, td {padding: 2px 5px}
th {
	color: white;
	text-align: center;
	background-color: #5d625c;
}
#lign1 {
	text-align: right;
	color: #c6c3bd;
}
#tri {
	color: blue;
	background-color : #dddad4;
}
#div1 {
    position: absolute;
	color: #c6c3bd;
}
tr:nth-child(odd) {
	background-color: #dddad4;
	color:#444;
}
tr:nth-child(even) {
	background-color: #c6c3bd;
	color:#444;
}
.tab1 {margin-top: -7px;}
.button {
	padding: 2px 4px;
	text-align: center;
	color: #ffffff;
	border-radius: 2px;
	text-decoration: none;
	font-size: 12px;
	background-color: #1227ef;
	box-shadow: inset 2px 2px 3px #828bc5, inset -2px -2px 2px #382f8299;
}
.button:active {color:#5d625c;}
.cont {display: flex;}
.f1, .f2 {
	flex: 1;
	font-size: 9px;
	margin-top: 3px;
}
.f1 {
	text-align: right;
	margin-right: 5px;
}
.f2 {
	text-align: left;
	margin-left: 5px;
}
              
            
!

JS

              
                var ctrclic = 0;
var flech_val = 1;
function fleches(flech,ord,idcol,ctrclic1)
{
	code = flech.innerHTML;
	if (ctrclic1 != 1 && idcol == "a") {
		if (flech_val == 1) {flech_remp = '▲';flechrecherche = "▼";flech_val = 2} else {flech_remp = '▼';flechrecherche = "▲";flech_val = 1;}
		code = code.replaceAll(flechrecherche,flech_remp);
		flech.innerHTML = code;
	}
}
function trieazero() {
	var verifid = document.getElementsByClassName('resultat2').length;
	if(verifid >= 0) {
		for (var k = 1; k<=verifid; k++) {
		let p2 = document.getElementById('resultat1');
		p2.remove();
		}
	}
}
//Tri
const compare = (ids, asc) => (row1, row2) => {
	const tdValue = (row, ids) => row.children[ids].textContent;
	const tri = (v1, v2) => v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2);
	return tri(tdValue(asc ? row1 : row2, ids), tdValue(asc ? row2 : row1, ids));
};
const tbody = document.querySelector('tbody');
const thx = document.querySelectorAll('#a, #b, #c');
const trxb = tbody.querySelectorAll('tr');
thx.forEach(tht => tht.addEventListener('click', () => {
	trieazero();
	let classe = Array.from(trxb).sort(compare(Array.from(thx).indexOf(tht), this.asc = !this.asc));
	ordre = this.asc;
	//Echap 1er clic colonne 1
	if (ctrclic == 0) {ctrclic=1} else {ctrclic=2}
	//Fin - Echapper...
	fleches(tht,ordre,thx[0].id,ctrclic);
	classe.forEach(tr => tbody.appendChild(tr));
}));
//Tri
//Filtre
for (var i = 1; i <= trxb.length; i++) {
	ajt = tbody.querySelector('tr:nth-of-type('+i+')').querySelector('td');
	ajt.innerHTML="<input type='checkbox'> " + ajt.innerHTML;
}
document.addEventListener( 'DOMContentLoaded', function trie() {
	const thisTable = document.getElementById('tbody1');
	let initialTable = [];
	for ( let i = 0; i < thisTable.rows.length; i++ ) {
		initialTable[i] = [];
		const objCells = thisTable.rows.item(i).cells;
		for ( let j = 0; j < objCells.length; j++ ) initialTable[i][j] = objCells.item(j).innerText;
	}
	document.getElementById("tri").addEventListener('input',  event => {
		const inputValue = document.getElementById("tri").value;
		if ( inputValue != '' || inputValue != 'undefined') {
			thisTable.innerHTML = "";
			for ( let i = 0; i < initialTable.length; i++ ) {
				if ( initialTable[i][0].toLowerCase().indexOf(inputValue.toLowerCase()) > -1
					 || initialTable[i][1].toLowerCase().indexOf(inputValue.toLowerCase()) > -1
					 || initialTable[i][2].toLowerCase().indexOf(inputValue.toLowerCase()) > -1
					) {
					thisTable.innerHTML += '<tr class="resultat2" id="resultat1" ><td><input type="checkbox"> '+initialTable[i][0]+'</td><td>'+initialTable[i][1]+'</td><td>'+initialTable[i][2]+'</td></tr>';
				}
			}
		} else {
			for ( let i = 0; i < initialTable.length; i++ ) {
				thisTable.innerHTML = '<tr><td>'+initialTable[i][0]+'</td><td>'+initialTable[i][1]+'</td><td>'+initialTable[i][2]+'</td></tr>';
			}
		}
	});
});
//Filtre
function recharge()
{
  var myInput = document.getElementById("tri");
  var myInputEvent = new Event('input',{bubbles:true,cancelable: true});
  myInput.value="";
  myInput.dispatchEvent(myInputEvent);
}
              
            
!
999px

Console