Files
face-attendance/templates/table.html
2026-05-01 19:55:59 +03:30

97 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ title }}</title>
<link rel="stylesheet" href="/static/styles.css">
<link rel="stylesheet" href="/static/tadel/jquery.dataTables.min.css" />
<link rel="stylesheet" href="/static/tadel/buttons.dataTables.min.css" />
<Script type="text/javascript" src="/static/tadel/jquery-1.12.3.js"></Script>
<Script type="text/javascript" src="/static/tadel/jquery.dataTables.min.js"></Script>
<Script type="text/javascript" src="/static/tadel/jszip.min.js"></Script>
<Script type="text/javascript" src="/static/tadel/buttons.html5.min.js"></Script>
<Script type="text/javascript" src="/static/tadel/dataTables.buttons.min.js"></Script>
<style>
th,td{
color: black;
border-color: black;
}
</style>
</head>
<body>
<header class="masthead bg-primary text-white text-center" dir="rtl">
<div class="container d-flex align-items-center flex-column" style="min-width:96%;">
<h2>{{ title }}</h2>
<hr class="dropdown-divider">
<script>
var col = document.getElementsByTagName('th').length-1;
$(document).ready(function () {
$(document).ready(function () {
$('table').DataTable({
dom: 'Blfrtip',
buttons: [{
text: 'دریافت فایل Excel',
extend: 'excelHtml5',
exportOptions: {
modifier: {
selected: true
},
columns: {{ columns }},
format: {
header: function (data, columnIdx) {
return data;
},
body: function (data, column, row) {
// Strip $ from salary column to make it numeric
debugger;
return column === col ? "" : data;
}
}
},
footer: false,
customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
//$('c[r=A1] t', sheet).text( 'Custom text' );
//$('row c[r^="C"]', sheet).attr('s', '2');
}
}]
});
});
});
</script>
<table>
<thead>
<tr>
{% for thead in theads %}
<th scope="col">{{ thead }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for tbody in tbodys %}
<tr>
{% for td in tbody %}
<td scope="col">{{ td }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</header>
</body>
</html>