Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81918

Input's width resizes - How to modify?

$
0
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!


Viewing all articles
Browse latest Browse all 81918

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>