Bootstrap, too wide right padding in header?

Bootstrap, too wide right padding in header?

rogerarogera Posts: 9Questions: 2Answers: 1

We are currently in progress of migrating our application to be more usable on phones and tablets and are using bootstrap for this. We also use Datatables a lot.

We have an issue with some tables with many non sortable columns. The columns are too wide due to a large right padding, even for non sortable columns, so they don't fit on our screen.

I think the right padding that's done in the bootstrap integration css (line 148-150) should only be done when we also have sorting and not for every condensed table.

table.dataTable.table-condensed > thead > tr > th {
padding-right: 20px;
}

If I just use ordinary bootstrap table with table-condensed the right padding is 5px, with Datatable it's 20px. Without the table-condensed Datatable has 30 or 8px as right padding depending on if sorting is enabled or not.

See http://live.datatables.net/novejeje/2/

Any comments on this?

Regards
/Roger

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,916Questions: 1Answers: 10,150 Site admin

    It does look like there is a bug in the integration stylesheet there. That needs to be looked at. Thanks for flagging it up.

    Allan

  • rogerarogera Posts: 9Questions: 2Answers: 1

    Still seems to be too wide padding, even in the latest nightly and released version.
    Regards
    /Roger

  • allanallan Posts: 61,916Questions: 1Answers: 10,150 Site admin
    Answer ✓

    I did some experimenting with this and found that if the padding is different on some cells then under certain conditions, with scrolling active, browser's could misalign the columns. That's way it is still as it was. If you aren't using scrolling then an override style would resolve that.

    Allan

  • rogerarogera Posts: 9Questions: 2Answers: 1

    OK, thanks for the explanation why it hasn't been implemented.
    I've not noticed the misalignment so probably don't hit the same conditions as you did or are not observant enough to notice it.
    We do use scrollX but not scrollY and have overridden the styles and it seems to work for us.

    Regards
    /Roger

  • allanallan Posts: 61,916Questions: 1Answers: 10,150 Site admin

    Yeah - it wasn't happening all the time, and it wasn't in all browsers. I'm afraid I can't remember the exact details at the moment, and I'll probably come back to this at some point in future, as it is a bit of a pain!

    Allan

This discussion has been closed.