Datatable width is bigger than conten of page

Datatable width is bigger than conten of page

hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0

Hello
My Datatabel is as below.

The content in my CSS is 940px.
The column width definition is together 630px. So normally the datatable should fit into the content.
The problem is that if some columns have large text, the table itself is bigger then the content of my page

How can you avoid that the datatable has more width than the content ?

The css is:

pdata {

font-size: 12px;
width: 920px;

}

oPTable = $("#pdata").dataTable({
"sAjaxSource": ajaxSourcePhp,
"sAjaxDataProp": "",
"autoWidth": false,
"aaSorting": [[ 1, "desc" ]],
"pagingType": "simple",
"bDestroy": true,

        "language": {
            "decimal": ",",
            "thousands": "."
        },
        "aoColumns": 

        [

        { "mData": "opportunitynumber",
            "sWidth": 100
        },
        { "mData": "customername",
            "sWidth": 150,
        },
        { "mData": "customernumber",
            "sWidth": 80
        },
        { "mData": "statusname",
            "sWidth": 80
        },
        { "mData": "contractstart",
            "sWidth": 100
        },
        { "mData": "rating",
            "sWidth": 50,
            "render": function ( data, type, row ) {
                return data +'%';
            }
        },
        { "mData": "approval",
            "sWidth": 70
                    }

        ],
        "iDisplayLength": 5,
         "aLengthMenu": [[5, 10, 25, 50], [5, 10, 25, 50]],
        "oLanguage": {
                "sUrl": "german.txt"
        }

    });

Answers

  • hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0

    Hello
    has nobody an idea for that problem?

    thanks a lot
    best regards
    hawk

This discussion has been closed.