Issue with setting column width

Issue with setting column width

AdamSAdamS Posts: 14Questions: 3Answers: 0

Hi I am trying to set the width of a column to 50%, but instead I get 50px... Here is the initialization code that I am using

$('#dataTable').dataTable( {
data: dados, //Array of Objects
columns: [
{
data: 'timestamp',
title: 'Date',
render: function (data, type, full) {
var formatedDate = new XDate(data).toString('dd MMMM yyyy')
return formatedDate;
}
},
{
data: 'headline',
title: 'Headline'
},
{
data: 'text',
title: 'Content',
width:'50%' //This does not work, i gives me 50px instead of 50%

                    },
                    {
                        data: 'author',
                        title: 'Author'
                    }
                ]
            } );

Answers

  • AdamSAdamS Posts: 14Questions: 3Answers: 0

    OK, this was my own fault if I add the autowidth to false then it behaves as expected. Still it's strange that if i pass a width value it affects the Table just not in the right way.

This discussion has been closed.