From 20c1ea8991f705733235884620dbb0a297cc945c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 24 Oct 2019 21:07:57 +0200 Subject: [PATCH] better table layout --- lam/lib/lists.inc | 13 +++---------- lam/style/500_layout.css | 10 ++++++++++ lam/style/responsive/120_lam.css | 3 ++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index df06bef1..f9733877 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -410,14 +410,6 @@ class lamList { $table->setOnClickEvents($onClickEvents); $table->setOnDoubleClickEvents($onDoubleClickEvents); $columnCount = sizeof($titles); - if ((100 / $columnCount) > 12) { - $widths = array('12%'); - for ($i = 1; $i < ($columnCount - 1); $i++) { - $widths[] = floor((100 - 12) / ($columnCount - 1)) . '%'; - } - $widths[] = ceil((100 - 12) / ($columnCount - 1)) . '%'; - $table->setWidths($widths); - } parseHtml(null, $table, array(), false, $this->tabindex, $scope); } @@ -475,7 +467,7 @@ class lamList { $actionElement->addElement($clearFilterButton); } - $filterElements = array(new htmlDiv(null, $actionElement, array('nowrap'))); + $filterElements = array(new htmlDiv(null, $actionElement, array('lam-listtools'))); $clearFilter = isset($_POST['clear_filter']); foreach ($this->attrArray as $attributeName) { $attributeName = strtolower($attributeName); @@ -504,6 +496,7 @@ class lamList { $filterInput = new htmlInputField('filter' . $attrName, $value, null); $filterInput->setCSSClasses(array($this->type->getScope() . '-bright')); $filterInput->setOnKeyPress("SubmitForm('apply_filter', event);"); + $filterInput->setFieldSize(null); return $filterInput; } @@ -547,7 +540,7 @@ class lamList { $onClickEvents[$rowNumber] = "list_click('" . $rowID . "');"; $onDoubleClickEvents[$rowNumber] = "top.location.href='../account/edit.php?type=" . $this->type->getId() . "&DN=" . rawurlencode($info[$index]['dn']) . "';"; $this->addToolLinks($info[$index], $rowID, $actionElement); - $row[] = new htmlDiv(null, $actionElement, array('nowrap')); + $row[] = new htmlDiv(null, $actionElement, array('lam-listtools')); foreach ($this->attrArray as $attributeName) { $attributeName = strtolower($attributeName); $row[] = $this->getTableCellContent($info[$index], $attributeName); diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index 8be80a0d..d9c3b4af 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -249,6 +249,16 @@ table.accountlist { border-style:solid; } +table.accountlist input[type='text'] { + width: 99%; + min-width: 10rem; +} + +.lam-listtools { + white-space: nowrap; + width: 125px; +} + table.collapse { border-collapse:collapse; } diff --git a/lam/style/responsive/120_lam.css b/lam/style/responsive/120_lam.css index af4369ea..eacc0716 100644 --- a/lam/style/responsive/120_lam.css +++ b/lam/style/responsive/120_lam.css @@ -92,7 +92,6 @@ select.auto-width { table.responsive-table { margin-top: 1rem; - table-layout: fixed; width: 100%; border-collapse: collapse; } @@ -103,6 +102,7 @@ table.responsive-table th { padding-top: 0.5rem; padding-right: 0.3rem; padding-left: 0.3rem; + white-space: nowrap; } table.responsive-table td { @@ -152,6 +152,7 @@ table.responsive-table td { content: attr(data-label); float: left; font-weight: bold; + margin-right: 5px; } table.responsive-table td:last-child {