BS5 styling issue in v2.3

BS5 styling issue in v2.3

RichardD2RichardD2 Posts: 15Questions: 2Answers: 1

Link to test case:
https://live.datatables.net/kefavusa/1/edit?html,output

Offending CSS rule:

table.dataTable.table-sm > thead > tr th.dt-orderable-asc,  
table.dataTable.table-sm > thead > tr th.dt-orderable-desc,  
table.dataTable.table-sm > thead > tr th.dt-ordering-asc,  
table.dataTable.table-sm > thead > tr th.dt-ordering-desc,  
table.dataTable.table-sm > thead > tr td.dt-orderable-asc,  
table.dataTable.table-sm > thead > tr td.dt-orderable-desc,  
table.dataTable.table-sm > thead > tr td.dt-ordering-asc,  
table.dataTable.table-sm > thead > tr td.dt-ordering-desc {
    padding-right: 20px;
}

Description of problem:
It looks like the Bootstrap 5 styling hasn't been completed updated to account for the header changes in v2.3 - the table-small rule still includes padding on the header cells, which pushes the new dt-column-header element to the right.

You can see the same problem on the Bootstrap 5 example page if you use the developer tools to add the table-sm class to the table.

Screenshot

Replies

  • RichardD2RichardD2 Posts: 15Questions: 2Answers: 1

    Correction: pushes the new dt-column-header element to the left.

  • RichardD2RichardD2 Posts: 15Questions: 2Answers: 1

    Another problematic rule:

    table.dataTable.table-sm > thead > tr th.dt-orderable-asc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr th.dt-orderable-desc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr th.dt-ordering-asc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr th.dt-ordering-desc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr td.dt-orderable-asc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr td.dt-orderable-desc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr td.dt-ordering-asc span.dt-column-order, 
    table.dataTable.table-sm > thead > tr td.dt-ordering-desc span.dt-column-order {
        right: 5px;
    }
    

    That pushes the sort indicator too far to the left - especially when the header text and sort indicator are swapped.

  • allanallan Posts: 64,338Questions: 1Answers: 10,623 Site admin

    Hi,

    Many thanks for flagging this up for me! I'd completely forgotten about the table-sm styles. I've committed a fix now. It will be in the nightly soon and I'll do a 2.3.1 release in the relatively near future (will allow a little time to see if anything else crops up from the 2.3.0 release).

    Allan

Sign In or Register to comment.