Column width resizing on load

Column width resizing on load

test42test42 Posts: 21Questions: 8Answers: 0


I had to add an additional column to my table and now it stretches well beyond 100% of my window. I'm trying to understand why on initial load it's respecting my code:

 var table = $('#test').DataTable({
            ajax: 'php/',
            columns: [{
                    "data": "name",
                    "width": "50px"

but immediately after it resizes to well beyond the window. I've tried everything - columnDefs, column width, manual css classes. It seems to be injecting inline style for the width after everything else. Is there a way to force a column to stay small?

I've looked at the responsive route and I've been able to set the ones I want in the detail view but it seems to force at least 4 down there when I only want 2 down there.

Any ideas?


  • colincolin Posts: 2,735Questions: 0Answers: 479

    Hi @test42 ,

    This would be hard to diagnose without seeing it running. Would you be able to your page, or if not, could you clone my example in your other thread to demonstrate the problem. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.



Sign In or Register to comment.