<script type="text/javascript">

	$(function() {
		// add new widget called repeatHeaders
		$.tablesorter.addWidget({
			// give the widget a id
			id: "repeatHeaders",
			// format is called when the on init and when a sorting has finished
			format: function(table) {
				// cache and collect all TH headers
				if(!this.headers) {
					var h = this.headers = []; 
					$("thead th",table).each(function() {
						h.push(
							"<th>" + $(this).text() + "</th>"
						);
						
					});
				}
				
				// remove appended headers by classname.
				$("tr.repated-header",table).remove();
				
				// loop all tr elements and insert a copy of the "headers"	
				for(var i=0; i < table.tBodies[0].rows.length; i++) {
					
				}
				
			}
		});
		
		// call the tablesorter plugin and assign widgets with id "zebra" (Default widget in the core) and the newly created "repeatHeaders"
		$("table").tablesorter({widgets: ['zebra','repeatHeaders']});
		({ 
			// sort on the first column and fourth column, order asc 
			sortList: [[0,0],[3,0]] 
		}); 
		$(".table1")
			.tablesorter({widthFixed: true, widgets: ["zebra"]})
			.tablesorterPager({container: $("#pager1"),
			output:  'Page {page} sur {totalPages}',  // Texte en français
            updateArrows: true,
            pageReset: 0,
            pageSize: 15,  // Ajustez la taille de la page si nécessaire
            fixedHeight: true});
		$(".table2")
			.tablesorter({widthFixed: true, widgets: ["zebra"]})
			.tablesorterPager({container: $("#pager2"),
			output:  'Page {page} sur {totalPages}',  // Texte en français
            updateArrows: true,
            pageReset: 0,
            pageSize: 15,  // Ajustez la taille de la page si nécessaire
            fixedHeight: true});
		$(".table3")
			.tablesorter({widthFixed: true, widgets: ["zebra"]})
			.tablesorterPager({container: $("#pager3"),
			output:  'Page {page} sur {totalPages}',  // Texte en français
            updateArrows: true,
            pageReset: 0,
            pageSize: 15,  // Ajustez la taille de la page si nécessaire
            fixedHeight: true});
		$(".table4")
			.tablesorter({widthFixed: true, widgets: ["zebra"]})
			.tablesorterPager({container: $("#pager4"),
			output:  '<?php echo PAGE; ?> {page} <?php echo ON; ?> {totalPages}',  // Texte en français
            updateArrows: true,
            pageReset: 0,
            pageSize: 15,  // Ajustez la taille de la page si nécessaire
            fixedHeight: true});

	}); 		
	
</script>