columns.width is incorrect
columns.width is incorrect
hitman333
Posts: 6Questions: 1Answers: 0
Hi. Please help. When I write like this:
$table.DataTable({
columns: [
{data: 'selected', width: "20px"},
{data: "qwe1"},
{data: "qwe2"},
{data: "qwe3"},
{data: 'qwe4'},
{data: 'qwe5'},
{data: "qwe6"},
{data: 'qwe7'},
{data: 'qwe8'},
{data: 'qwe9'}
]
My 1 column must be 20px. But on the site I have 20.91px. (Look at attach)
How can I change this and set 20px?
This discussion has been closed.
Answers
And what is the interesting. When I add >= 220px to the another column, then my 1 column is correctly 20px and another 220px. But if it is <220px then the bug is here.
Do you have any padding defined on the header cell perhaps? If you can link to a page showing the issue that would be useful.
Allan
What is the page you mean? With my project? It is not possible to show you my project.
And I have not any padding.
Can you recreate the issue on http://live.datatables.net , JSFiddle, CodePen or something else so I can take a look please?
Allan
It is a little difficult because I have a lot of code and it is angular.
But I find some interesting. It is because
$table.DataTable({
scrollY: true
})
When scrollY: false the size of my columns is ok. But if we have scroll we have this bug. Maybe now you know what we can do?))
With scrollY http://joxi.ru/a2X9qpEuyx1gpA
Without scrollY http://joxi.ru/a2X9qpEuyx17pA