Show the Yajra datatable's horizontal scrollbar at the bottom of the browser window

When using Yajra datatable, the Horizontal scrollbar typically appears at the bottom of the webpage. However, I am looking to have it display at the bottom of the browser window instead. The datatable is contained within a card.

I attempted to achieve this by adding the following code in the style tag, but it did not work:

`
    <style>
    .dataTables_scrollBody {
        overflow-x: scroll;
        overflow-y: hidden;
        position: absolute;
        bottom: 0;
    }
    </style>

`

Answer №1

It's possible that your styles are being overridden by other classes or styles. To ensure they take precedence, you may want to nest them within a parent element and use the !important declaration.

<style>
  .parent-container {
      position: relative;
  }

  .dataTables_scrollBody {
      overflow-x: scroll !important;
      overflow-y: hidden !important;
      position: absolute !important;
      bottom: 0 !important;
  }
</style>
<div class="parent-container">
  <!-- Your DataTable -->
  
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Methods for creating overlapping background images in breadcrumbs

I am having trouble with making the breadcrumb frame overlap the inside images. I attempted using z-index: -1, but it causes the images to disappear. Please refer to the attached image for a better understanding. Thank you. .breadcrumb { margin-botto ...

jQuery UI DatePicker: without any styling, no picking dates

I'm struggling to configure a jQuery UI DatePicker. I moved the development-bundle folder contents to the directory res/jqueryui and initialized two datepickers as shown below: <script src="res/jquery-2.1.0.min.js"></script> <script sr ...

Alter the appearance of another div when focused on

Is there a way to change the fill color of the SVG when a user focuses on the input field? I have included the HTML and SCSS for reference, but I'm not sure how to write the CSS code to achieve this effect. <div class="search"> <svg widt ...

Does clicking outside a contenteditable div still give it focus?

Due to a specific requirement, I must utilize a contenteditable div instead of a standard text input for entering text. Everything was going smoothly until I discovered that setting the contenteditable div with display: inline-block causes it to receive fo ...

What is the best way to conceal or eliminate slider increments and their corresponding labels in plotly.js?

Is there a way to eliminate or conceal the step ticks and labels of the animation slider? I want to get rid of the slider's step markers (ticks) and the corresponding labels: 'Red', 'Green' and 'Blue' located beneath the ...

Trouble with CSS and JS tabs not activating when clicked?

I am experiencing issues with a navigation (organized in tabs) that is not functioning on this page, but it works correctly on this page using the same method for inclusion. When clicking "Norway" on the top left, the navigation opens but switching to the ...

How can you ensure an element's height matches its width within an Ionic framework?

I am currently creating an application using the Ionic framework, and I am looking to set a square image as the background. The challenge is to ensure that the image scales appropriately for different screen resolutions; ideally, it should occupy the full ...

Inserting a picture using CSS

I attempted to include an image in a footer div, but I have not been successful with the following approach: Here is the HTML code I tried: <footer> <div class="imagenFooter" style="background-image: url(&quot;./images/footer-bg.jpg&quo ...

Creating a stylish flyout search box using CSS

I am looking to create a search box that pops up when a button is clicked and disappears when clicked outside. My approach involves using CSS to achieve this functionality. Here is the HTML structure I am working with: <div tabindex="0" class="search" ...

Exterior Buttons to Operate Carousel

I have been attempting to create a carousel with the control arrows positioned outside of it, but I am encountering difficulty getting the arrows to display correctly. When I place the controls code outside the carousel, they function as intended but do no ...

What is the best way to line up a checkbox and its labels alongside a dropdown menu?

My index.html file has a header like this: https://i.sstatic.net/s0hAt.png I'm trying to align the checkbox and its label with the dropdown menu "In ordine". I'm using only bootstrap (no custom classes) and my current page layout is as follows. ...

fullcalendar adjusting color while being moved

Currently, I have implemented a fullcalendar feature that displays entries for multiple users with different colored calendars. However, there seems to be an issue when dragging an entry to another date - the color reverts back to default. Below is an exa ...

Implementing modifications to all HTML elements simultaneously

In my HTML document, there are around 80 small boxes arranged in a grid layout. Each box contains unique text but follows the same structure with three values: name, email, and mobile number. I need to switch the positions of the email and mobile number v ...

Adjust the height of an element using CSS based on the height of another

Is there a way to have two divs per row, where the second div always displays its full content and the height of the first div matches the height of the second div? If the content in the first div exceeds the height, it should be scrollable. I've atte ...

The issue with updating the menu class in Internet Explorer 8 is not being resolved

Here is a code snippet using JavaScript: var x = jQuery(window).innerHeight(); jQuery(document).scroll(function() { if (jQuery(this).scrollTop() >= x) { jQuery('#nav').removeClass('nav').addClass('topfix_nav'); ...

Combining multiple .php files in a single div

Hey there! I have a piece of code that allows me to load a PHP file into a div. It's currently functional, but I'm facing a challenge where I need to load the next file into the same div. <script type="text/javascript"> $(function() { ...

What is the best way to adjust text colors with a click of the mouse?

Is there a way to change the color of the text 'test' in the class 't1' when it is clicked on? I would like both texts to change color even if only one is clicked. The texts are separated by another div for design purposes. I appreciat ...

Update the src path for the backgroundImage in ReactJS to pull from a directory within the CSS

I'm currently working on changing the ImageBackground for a Material-UI Button Image component. The challenge I'm facing is that the CSS configuration requires a backgroundImage property, but it searches through the URL browser instead of my loca ...

Require the capability to bypass inline CSS styling

Currently facing an issue with a wordpress website I am constructing using iThemes Builder. The problem arises when integrating the plugin Jquery Megamenu, as the drop-down menu gets truncated due to an overflow:hidden property that cannot be overridden i ...

How do I incorporate scrolling into Material-UI Tabs?

I am currently incorporating Material-ui Tablist into my AppBar component. However, I am facing an issue with the responsiveness of the tabs. When there are too many tabs, some of them become hidden on smaller screens. For more information on the componen ...