better table layout

This commit is contained in:
Roland Gruber 2019-10-24 21:07:57 +02:00
parent f21f8ee423
commit 20c1ea8991
3 changed files with 15 additions and 11 deletions

View File

@ -410,14 +410,6 @@ class lamList {
$table->setOnClickEvents($onClickEvents); $table->setOnClickEvents($onClickEvents);
$table->setOnDoubleClickEvents($onDoubleClickEvents); $table->setOnDoubleClickEvents($onDoubleClickEvents);
$columnCount = sizeof($titles); $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); parseHtml(null, $table, array(), false, $this->tabindex, $scope);
} }
@ -475,7 +467,7 @@ class lamList {
$actionElement->addElement($clearFilterButton); $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']); $clearFilter = isset($_POST['clear_filter']);
foreach ($this->attrArray as $attributeName) { foreach ($this->attrArray as $attributeName) {
$attributeName = strtolower($attributeName); $attributeName = strtolower($attributeName);
@ -504,6 +496,7 @@ class lamList {
$filterInput = new htmlInputField('filter' . $attrName, $value, null); $filterInput = new htmlInputField('filter' . $attrName, $value, null);
$filterInput->setCSSClasses(array($this->type->getScope() . '-bright')); $filterInput->setCSSClasses(array($this->type->getScope() . '-bright'));
$filterInput->setOnKeyPress("SubmitForm('apply_filter', event);"); $filterInput->setOnKeyPress("SubmitForm('apply_filter', event);");
$filterInput->setFieldSize(null);
return $filterInput; return $filterInput;
} }
@ -547,7 +540,7 @@ class lamList {
$onClickEvents[$rowNumber] = "list_click('" . $rowID . "');"; $onClickEvents[$rowNumber] = "list_click('" . $rowID . "');";
$onDoubleClickEvents[$rowNumber] = "top.location.href='../account/edit.php?type=" . $this->type->getId() . "&amp;DN=" . rawurlencode($info[$index]['dn']) . "';"; $onDoubleClickEvents[$rowNumber] = "top.location.href='../account/edit.php?type=" . $this->type->getId() . "&amp;DN=" . rawurlencode($info[$index]['dn']) . "';";
$this->addToolLinks($info[$index], $rowID, $actionElement); $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) { foreach ($this->attrArray as $attributeName) {
$attributeName = strtolower($attributeName); $attributeName = strtolower($attributeName);
$row[] = $this->getTableCellContent($info[$index], $attributeName); $row[] = $this->getTableCellContent($info[$index], $attributeName);

View File

@ -249,6 +249,16 @@ table.accountlist {
border-style:solid; border-style:solid;
} }
table.accountlist input[type='text'] {
width: 99%;
min-width: 10rem;
}
.lam-listtools {
white-space: nowrap;
width: 125px;
}
table.collapse { table.collapse {
border-collapse:collapse; border-collapse:collapse;
} }

View File

@ -92,7 +92,6 @@ select.auto-width {
table.responsive-table { table.responsive-table {
margin-top: 1rem; margin-top: 1rem;
table-layout: fixed;
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
@ -103,6 +102,7 @@ table.responsive-table th {
padding-top: 0.5rem; padding-top: 0.5rem;
padding-right: 0.3rem; padding-right: 0.3rem;
padding-left: 0.3rem; padding-left: 0.3rem;
white-space: nowrap;
} }
table.responsive-table td { table.responsive-table td {
@ -152,6 +152,7 @@ table.responsive-table td {
content: attr(data-label); content: attr(data-label);
float: left; float: left;
font-weight: bold; font-weight: bold;
margin-right: 5px;
} }
table.responsive-table td:last-child { table.responsive-table td:last-child {