Initial project
This commit is contained in:
96
templates/table.html
Normal file
96
templates/table.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user