Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

Last Column is not showing in DataTable

My HTML code is like below.

<div class="display responsive nowrap table-responsive billing-center-area bg-off-white theme-border radius-4 p-25">
<table id="rentreviewDatatable" class="table responsive theme-border p-20 dt-responsive">
    <thead>
        <tr>
            <th>{{ __('Property') }}</th>
            <th>{{ __('Unit') }}</th>
            <th>{{ __('Tenant') }}</th>
            <th>{{ __('Start') }}</th>
            <th>{{ __('End') }}</th>
            <th>{{ __('Current Rent') }}</th>
            <th>{{ __('Original Rent Start Date') }}</th>
            <th>{{ __('Status') }}</th>
            <th>{{ __('Action') }}</th>
        </tr>
    </thead>
</table>

My DataTable jQuery code is like below.

$('#rentreviewDatatable').DataTable({
processing: true,
serverSide: true,
pageLength: 100,
responsive: true,
ajax: $('#rentreviewRoute').val(),
order: [1, 'desc'],
ordering: false,
autoWidth: false,
drawCallback: function () {
    $(".dataTables_length select").addClass("form-select form-select-sm");
},
language: {
    'paginate': {
        'previous': '<span class="iconify" data-icon="icons8:angle-left"></span>',
        'next': '<span class="iconify" data-icon="icons8:angle-right"></span>'
    }
},
columns: [
    {
        "data": "property",
    },
    {
        "data": "unit",
    },
    {
        "data": "tenant",
    },
    {
        "data": "start",
    },
    {
        "data": "end",
    },
    {
        "data": "current_rent",
    },
    {
        "data": "original_rent_start_date",
    },
    {
        "data": "status",
    },
    {
        "data": "action",
    },
]

});

I am getting output like below.

https://i.sstatic.net/9yHrxyKN.png

I would like to show Action column.

0 likes
1 reply
Snapey's avatar
Snapey
Best Answer
Level 122

Your table-responsive is causing the header to wrap onto a new row

Your table does not display any actions (only the header) because you have not defined any

1 like

Please or to participate in this conversation.