adjust column widths to fit their content

This commit is contained in:
MaysWind
2025-11-23 15:18:40 +08:00
parent 837a62a534
commit 45be96cf68
2 changed files with 30 additions and 2 deletions

View File

@@ -137,7 +137,7 @@
multi-sort
density="compact"
item-value="index"
:class="{ 'disabled': loading }"
:class="{ 'reconciliation-statement-table': true, 'disabled': loading }"
:headers="dataTableHeaders"
:items="reconciliationStatements?.transactions ?? []"
:hover="true"
@@ -400,7 +400,7 @@ const dataTableHeaders = computed<object[]>(() => {
headers.push({ key: 'sourceAccountName', value: 'sourceAccountName', title: tt('Account'), sortable: true, nowrap: true });
headers.push({ key: 'accountBalance', value: 'accountBalance', title: tt(accountBalanceName), sortable: true, nowrap: true });
headers.push({ key: 'comment', value: 'comment', title: tt('Description'), sortable: true, nowrap: true });
headers.push({ key: 'operation', title: tt('Operation'), sortable: false, nowrap: true, align: 'end' });
headers.push({ key: 'operation', title: tt('Operation'), sortable: false, nowrap: true, align: 'center' });
return headers;
});
@@ -617,3 +617,18 @@ defineExpose({
open
});
</script>
<style>
.reconciliation-statement-table > .v-table__wrapper > table {
th:not(:nth-last-child(2)),
td:not(:nth-last-child(2)) {
width: auto !important;
white-space: nowrap;
}
th:nth-last-child(2),
td:nth-last-child(2) {
width: 100% !important;
}
}
</style>

View File

@@ -1948,6 +1948,19 @@ defineExpose({
</script>
<style>
.import-transaction-table > .v-table__wrapper > table {
th:not(:last-child),
td:not(:last-child) {
width: auto !important;
white-space: nowrap;
}
th:last-child,
td:last-child {
width: 100% !important;
}
}
.import-transaction-table .v-autocomplete.v-input.v-input--density-compact:not(.v-textarea) .v-field__input,
.import-transaction-table .v-select.v-input.v-input--density-compact:not(.v-textarea) .v-field__input {
min-height: inherit;