diff --git a/resources/js/Components/DataTable/Builder.vue b/resources/js/Components/DataTable/Builder.vue index e5f72b6..0c717f2 100644 --- a/resources/js/Components/DataTable/Builder.vue +++ b/resources/js/Components/DataTable/Builder.vue @@ -74,7 +74,7 @@ const createFloatingTh = () => { let ths = tfoot.querySelectorAll('th') ths.forEach((th, i) => { const floating = document.createElement('div') - floating.className = 'absolute top-0 left-0 w-full h-full border border-1 border-inherit' + floating.className = 'absolute bottom-0 left-0 w-full h-full border border-1 border-inherit' i === 0 && floating.classList.add('rounded-bl-md') i + 1 === ths.length && floating.classList.add('rounded-br-md') @@ -83,6 +83,15 @@ const createFloatingTh = () => { } } +const inherit = () => { + const { thead, tfoot } = self.refs + + if (thead && tfoot) { + thead.querySelectorAll('th').forEach(th => th.classList.add('bg-inherit', 'border-inherit')) + tfoot.querySelectorAll('th').forEach(th => th.classList.add('bg-inherit', 'border-inherit')) + } +} + const rounded = () => { const { links } = self.refs @@ -92,6 +101,7 @@ const rounded = () => { onMounted(fetch) onMounted(() => config.sticky && createFloatingTh()) +onMounted(() => inherit()) onMounted(() => rounded()) onUpdated(() => rounded()) @@ -102,11 +112,11 @@ onUpdated(() => rounded())