Skip to content

Commit c39dbc7

Browse files
committed
Add fixed layout to Table widget
1 parent 4dc5791 commit c39dbc7

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

components/src/widgets/complexTable/widget.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<ui-table :headers="props.headers">
2+
<ui-table
3+
:headers="props.headers"
4+
:fixed="fixed"
5+
>
36
<slot />
47
</ui-table>
58
<div class="buttons-container">
@@ -62,7 +65,11 @@ const props = defineProps({
6265
totalItems: {
6366
type: Number,
6467
default: 1,
65-
}
68+
},
69+
fixed: {
70+
type: Boolean,
71+
default: false,
72+
},
6673
});
6774
6875
const totalPages = computed(() => Math.ceil(props.totalItems / ITEMS_PER_PAGE))

components/src/widgets/table/widget.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<template>
22
<div class="table">
3-
<table>
3+
<table :class="{ fixed: fixed }">
44
<thead v-if="headers.length">
55
<tr>
66
<th
77
v-for="header in headers"
88
:key="header.name"
9+
:style="{ width: header.width }"
910
>
1011
<div>{{ header.text }}</div>
1112
<div class="splitpane" />
@@ -26,6 +27,10 @@ defineProps({
2627
required: true,
2728
default: () => [],
2829
},
30+
fixed: {
31+
type: Boolean,
32+
default: false,
33+
}
2934
})
3035
</script>
3136

@@ -36,6 +41,10 @@ table {
3641
width: 100%;
3742
max-width: 100%;
3843
44+
&.fixed {
45+
table-layout: fixed;
46+
}
47+
3948
thead {
4049
border-top: 1px solid #e0e0e0;
4150
border-bottom: 1px solid #e0e0e0;

0 commit comments

Comments
 (0)