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

LaravelFan's avatar

Yajra-based data table not responsive

Hi,

I'm using Yajra datatable but the page (index.blade.php) where the orders are showing is not responsive and the console is not showing errors.

This is the master.blade.php template:

This is the sidebar.blade.php:


<div class="dashboard_sidebar">
    <span class="close_icon">
        <i class="far fa-bars dash_bar"></i>
        <i class="far fa-times dash_close"></i>
    </span>
    <h1 style="color: #fff; font-size: 1.4rem; margin: 20px;">The Online Shop</h1> 
    <ul class="dashboard_link">
        <li><a class="active" href="{{ route('user.dashboard') }}"><i class="fas fa-tachometer"></i>Mein Konto</a></li>
        <li><a href="{{ route('index') }}"><i class="fas fa-home"></i>Startseite</a></li>
        <li><a href="{{ route('orders.index') }}"><i class="fas fa-shopping-cart"></i> Bestellungen</a></li>
        <li><a href="{{ route('user.profile') }}"><i class="far fa-user"></i> Mein Profil</a></li>
        <li><a href="{{ route('user.address') }}"><i class="fas fa-map-marker-alt"></i> Adressen</a></li>
        <li><a href="{{ route('vendor-request.index') }}"><i class="far fa-user"></i> Verkäufer werden</a></li>
        <li>
            <form method="POST" action="{{ route('logout') }}">
                @csrf
                <a href="{{ route('logout') }}"onclick="event.preventDefault();
            this.closest('form').submit();"><i class="far fa-sign-out-alt"></i> Abmelden</a>
            </form>
        </li>
    </ul>
</div>


This is the index.blade.php where the data table which displays the orders but is not responsive:

Grateful for your guidance.

0 likes
7 replies
jlrdw's avatar

Are you sure you have the css for the media queries included?

LaravelFan's avatar

@jlrdw Hi, I learned that there are two new links but they don't have an effect on the responsivness of the data table:


1. <script src="//cdn.datatables.net/2.0.7/js/jquery.dataTables.min.js"></script>
2. <link rel="stylesheet" href="//cdn.datatables.net/2.0.7/css/jquery.dataTables.min.css">

When I removed the old versions from the master.blade.php file, the data table was no longer rendering the data.


1. <link rel="stylesheet" href="//cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
2.  <script src="//cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>

LaravelFan's avatar

@jlrdw Good advice, I did a hard refresh but the result is still the same - it's not responsive.

LaravelFan's avatar

@jlrdw Many thanks, I'll check the resources and let you know how it goes.

Please or to participate in this conversation.