TD width not the same as TH width

TD width not the same as TH width

mole1066mole1066 Posts: 7Questions: 0Answers: 0
edited September 2010 in General
I've seen a couple of posts on this but nothing seems to address my issue.

I am using DataTables within a ruby on rails ap and am rendering it using Firefox.

I've started with a table that looks absolutely fine. When I get DataTables to take over the widths of the header cells are not the same as the width of the body cells.

I have set the "bAutoWidth": true parameter which makes the table look better but doesn't sort out the issue.

If I use the

"aoColumns": [
{ "sWidth": "30px" },
]


command it changes the width of the header, but leaves the body alone.

I've checked my code and can see that the tbody and thead elements are correctly applied, and in fact the functionality works fine so that shouldn't be an issue.

It's just that everything is misaligned. It seems that the tbody cells are slightly overlapping the cells to the left. I've checked the css and can't see any negative values.

when I look at the CSS through firebug I can see the ui-state-default parameters and that the width has a setting for the thead elements. However for the tbody elements I just have a standard

any thoughts?

Michael

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you open the Firebug console, are there any messages from DataTables? It can occur sometimes that there simply isn't the width available in order to render the table, but this should be indicated and suggestions made.

    Beyond that, can you give us a link to show the problem please (or http://datatables.net/contact if you don't want to make it public). That will help me to see what is going on and what might be causing it.

    Thanks,
    Allan
  • mole1066mole1066 Posts: 7Questions: 0Answers: 0
    Making it public would be problematic as it is in my dev environment, and don't want to release it until it works ....

    I guess I could create a replica of the page on my live site with a hidden name, but I won't be able to get that done until Friday morning due to other things that would also.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi mole1066,

    Yup no problem. It does make the debugging that I can do remotely rather limited though. A screenshot might show some indication of what is happening? Were there any Firebug messages?

    Allan
This discussion has been closed.