Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[datatables] fixedColumns = true not working (columns resize when paginating) #1009

Open
marceloverdijk opened this issue Dec 19, 2024 · 0 comments

Comments

@marceloverdijk
Copy link

marceloverdijk commented Dec 19, 2024

Describe the bug

simple-datatables has it's option fixedColumns set to true by default, but it does not work.
When navigating through the pages, the column width's change.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://flowbite.com/docs/plugins/datatables/#table-pagination
  2. Click on the next page in datatable
  3. The width's of the columns change

Expected behavior
Datatables should have fixed columns by default, so when navigating column width of columns won't change.

Additional context

How this works is that simple-datatables calculates the width for each column and puts that in the header like:

<th style="width: 25.261780104712038%;">
    <span class="flex items-center">
        Model Name
    </span>
</th>

The issue is Flowbite adds:

.datatable-wrapper .datatable-table tbody td, .datatable-wrapper .datatable-table tbody th, .datatable-wrapper .datatable-table thead th {
    width: auto !important;
}

See https://github.com/themesberg/flowbite/blob/main/plugin.js#L710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant