DataTables / DataTables/Dist-DataTables-Bootstrap5

Select All checkbox in table header is misaligned with table rows

Open Beginner friendly
#13 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
21
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Using the latest datatables.net-dt and datatables.net-bs5 packages (v2.3.2), when the DataTable.render.select() checkbox is rendered, the Select All checkbox in the header is slightly out of alignment with the checkboxes in the table rows:

alignment

The cause appears to be the display of the <span class="dt-column-order"></span> element and the styling attached to div.dt-column-header, which is:

https://github.com/DataTables/Dist-DataTables-Bootstrap5/blob/b63a2add4a1dd1c84bb614d64d739b5e2994187a/css/dataTables.bootstrap5.css#L155-L158

This causes .dt-column-order to affect the layout. I see there's special handling for span.dt-column-title:empty so perhaps that needs to be extended to .dt-column-order:empty as well.

Example table:

new DataTable('#table', {
  columns: [{ orderable: false, render: DataTable.render.select() }],
  select: {
    style: 'multi', // but affects other styles like `os` too
  },
});

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in css/dataTables.bootstrap5.css around lines 155-158 and inspect the styling on div.dt-column-header, span.dt-column-title:empty, and .dt-column-order. Reproduce the provided DataTable.render.select() example with datatables.net-dt and datatables.net-bs5 v2.3.2, then adjust the empty-header layout so the Select All checkbox aligns with row checkboxes without disrupting other select styles.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.