Input's width resizes - How to modify?
Input's width resizes - How to modify?
Peacepipe
Posts: 9Questions: 4Answers: 0
Hello,
I've a table for which I'm using DataTable.
This table has input fields inside each row. This is the current view of the table without DataTable:
However, when DataTable is added:
@section scripts{
<script>
$(document).ready(function () {
$("#contadores").DataTable({
stateSave: true
});
});
</script>
}
The table resizes becoming wider:
I would like to know how to resize this columns. I've tried with this: https://datatables.net/reference/option/columns.width
@section scripts{
<script>
$(document).ready(function () {
$("#contadores").DataTable({
stateSave: true,
"columnDefs": [
{ "width": "20%", "targets": 4 }
]
});
});
</script>
}
But there are no changes.
Thanks!
This discussion has been closed.
Answers
Try declaring the table with the
width
attribute as100%
, for example:This "trick" is useful to me.