[FIX] Table width and header

This commit is contained in:
Peter Pfeufer 2023-12-10 14:06:04 +01:00
parent 0a6a6e0bf9
commit e16bb2a737
No known key found for this signature in database
GPG Key ID: 6051D2C6AD4EBC27
2 changed files with 10 additions and 9 deletions

View File

@ -58,7 +58,7 @@
{# {% include "bundles/filterdropdown-js.html" %}#} {# {% include "bundles/filterdropdown-js.html" %}#}
<script> <script>
$(document).ready(function () { $(document).ready(() => {
const groupColumn = 0; const groupColumn = 0;
$('#tab_permissions_audit').DataTable({ $('#tab_permissions_audit').DataTable({
@ -88,9 +88,9 @@
api.column(groupColumn, { api.column(groupColumn, {
page: 'current' page: 'current'
}).data().each(function (group, i) { }).data().each((group, i) => {
if (last !== group) { if (last !== group) {
$(rows).eq(i).before(`<tr class="h4 table-secondary"><td colspan="3">${group}</td></tr>`; $(rows).eq(i).before(`<tr class="h5 table-secondary"><td colspan="3">${group}</td></tr>`);
last = group; last = group;
} }

View File

@ -23,7 +23,7 @@
</p> </p>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped" id="tab_permissions_overview"> <table class="table table-striped" id="tab_permissions_overview" style="width: 100%;">
<thead> <thead>
<tr> <tr>
<th scope="col">{% translate "App" %}</th> <th scope="col">{% translate "App" %}</th>
@ -77,7 +77,8 @@
[2, 'asc'] [2, 'asc']
], ],
filterDropDown: { filterDropDown: {
columns: [{ columns: [
{
idx: 0 idx: 0
}, },
{ {
@ -88,7 +89,7 @@
}, },
"stateSave": true, "stateSave": true,
"stateDuration": 0, "stateDuration": 0,
drawCallback: (settings) => { drawCallback: function(settings) {
const api = this.api(); const api = this.api();
const rows = api.rows({ const rows = api.rows({
page: 'current' page: 'current'
@ -99,7 +100,7 @@
page: 'current' page: 'current'
}).data().each((group, i) => { }).data().each((group, i) => {
if (last !== group) { if (last !== group) {
$(rows).eq(i).before(`<tr class="h4 table-secondary"><td colspan="6">${group}</td></tr>`); $(rows).eq(i).before(`<tr class="h5 table-secondary"><td colspan="6">${group}</td></tr>`);
last = group; last = group;
} }