From e55911830568d1c9281c99b54c44a9b263c87b86 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 12 Aug 2020 13:58:58 +0100 Subject: [PATCH] Bug 26189: Improve styling of datatables within fieldsets This patch improves the responsive layout of datatables (and tables generally) by setting layout to 'fixed' and and enabled word-wrap on table cells. We also reset the margins for datatables found inside fieldsets such that the datatable properly utilises the available space and we restore the default datatable label font weights. --- koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss | 4 ++++ koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss | 10 ++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss index 31bf388136..793c2617da 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss @@ -1,7 +1,9 @@ table { + table-layout: fixed; border-collapse: collapse; border-right: 1px solid $table-border-color; border-top: 1px solid $table-border-color; + width: 100%; .btn-group { white-space: nowrap; @@ -124,6 +126,8 @@ th { border-bottom: 1px solid $table-border-color; border-left: 1px solid $table-border-color; padding: .2em .3em; + word-wrap: break-all; + word-wrap: break-word; } td { diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index e339309288..bfdf40f100 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -898,6 +898,10 @@ fieldset { font-size: 105%; margin: 1em 0 1em 1em; + &.dataTable { + margin: 0; + } + &.mceListBox { margin: 0; } @@ -921,6 +925,12 @@ fieldset { clear: both; padding-top: .5em; } + + .dataTables_wrapper { + label { + font-weight: 400; + } + } } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt index 19da1e16a8..0447bc0caf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -338,7 +338,8 @@ "aoColumnDefs": [ { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false }, ], - }, items_columns_settings); + "bAutoWidth": false + }, items_columns_settings, false); $(".add_button").on("click", function(e) { e.preventDefault(); -- 2.20.1