What is the best way to incorporate a horizontal scroll bar at the top of a table?

<div class="table-responsive">
                
                  <table class="table table-striped">
                     
                    <thead>
                      <tr>
                        <th>Administrator Name</th>
                        <th>Total number of audits conducted</th>
                        <th>Fatal Incidents</th>
                        <th>Performance Score</th>  
                        <th>Average Result</th>      
                      </tr>
                    </thead>
                    <!-- <div style="overflow:scroll;min-height:.01%;overflow-y:hidden;overflow-x:scroll;"> -->
                  <tbody>
                 
                   
                        <?php 
                      
                        $totalaudits=0;
                        $totalfatalities=0;
                        $auditList=$aucnt->result();   
                        $totalaudits+=$rpostclist->audited;
                        $totalfatalities+=$rpostclist->cnfatal;
                        ?>
                          <tr>
                              <td><?php echo $rpostclist->administrator_name;?></td>
                              <td><?php echo $rpostclist->audited;?></td>
                              <td><?php echo $rpostclist->cnfatal;?></td>
                              
                              <td>
                                
                                <table class="table table-bordered">
                                  <tr>
                                                        <?php  $i=1; foreach($auditList as $raucnt) { ?>
                                      <th> Call <?php echo $i;?><br/><?php echo $raucnt->qa_agent;?><br/><?php echo $raucnt->qa_date; ?><br><a href="<?php echo base_url();?>home/viewticket/<?php echo $raucnt->unique_id;?>" class="btn btn-link" target="_blank" style="width:55px;height:30px;">View</a></th>
                                        <?php $i++;} ?>
                                  </tr>
                                  <tr>
                                    <?php $sum = 0; foreach($auditList as $raucnt) { ?>
                                    <td><?php echo $raucnt->tot;
                                                          $sum += $raucnt->tot;?>%</td>
                                    <?php } ?>
                                  </tr>
                                
                                </table>
                              </td>
                            <td style="vertical-align:middle;font-weight:bold;font-size:20px;"><?php echo round($average=$sum/count($auditList));?>%</td>
                          </tr>
                 
                        <?php } ?>
                        <tr>
                            <td></td>
                            <td style="font-size:16px;"><strong>Total:<?php echo $totalaudits;?></strong></td>
                            <td style="font-size:16px;"><strong>Total:<?php echo $totalfatalities;?></strong></td>
                        </tr>
                        </tbody>
                    </table>
                    </div>
              </div>
                                    </div>

I searched extensively but did not find any solutions. I am attempting to maintain a horizontal bar at the top of the table due to the large amount of database data it retrieves, making scrolling difficult. Perhaps having both top and bottom horizontal scroll bars would also be a good suggestion.

Answer №1

I flipped the orientation of my container to 180 degrees

<div class=" table-responsive"style="transform: rotateX(180deg);">
                
                  <table class="table table-striped" style="transform: rotateX(180deg);">

Answer №2

<div class="table-responsive">

modify to

<div class="table-responsive" style="overflow-y: scroll; overflow-x: auto">

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

Having trouble navigating to the bottom of a VUEJS app?

I've been working on developing a chatbot app that utilizes a REST API to stream content. While the functionality of the app is running smoothly, I have encountered an issue with the scroll to bottom feature. Instead of automatically scrolling to disp ...

Animating slides with CSS Keyframes and React, incorporating toggle slide fade out and slide fade (back) in

I am seeking a solution for toggling a box (div) with slide-out animation and then sliding back in animation (in reverse) upon button press. My requirement is to have no animations during the initial page render. While I can successfully slide the box to ...

Having issues with the CSS block in my Jekyll dropdown navbar

I have been exploring resources from both w3schools and another website to create a navigation bar in Jekyll using frontmatter. However, I am running into issues with the block property in CSS. Most of the navbar is functioning properly, except for the dro ...

Error: Attempting to access 'position' property of undefined object in ThreeJs is causing a TypeError

I am currently facing an issue with integrating a 3D model into the background of the hero section on my website. The integration works fine, but I noticed that when I manually resize the window, the 3D model does not adjust to the new size. Additionally, ...

What could be causing my page width to only expand to 100% when using "fit-content"?

After searching extensively, I'm unable to find a solution that fits my current issue. My goal is to construct a practice ecommerce website using React. One of the components I have is a header which I'd like to occupy 100% of the screen width, c ...

What is the best way to ensure a specific section of a website remains visible and fixed at the bottom of the page

I want to set up a simple toolbar with divs and uls containing both anchors and tabs. The position of the toolbar needs to be fixed at the bottom of the page. <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/ ...

Adjusting element placement on collapsed navbar using Bootstrap

I've been developing a navbar for a webpage and have successfully aligned the data left and right with the Brand in the center. However, when the navbar collapses, the alignment shifts to Left (over) Brand (over) Right. I want the Brand to remain at t ...

Difficulty encountered with pagination links functioning in CodeIgniter

While implementing pagination in CodeIgniter using Ajax, I am encountering an issue with the pagination links. When I click on the second link, the URL changes but no data is loaded on the second page. Additionally, the first link remains active along with ...

TailwindCSS: Footer component overlaps central panel when scrolling on mobile devices

https://play.tailwindcss.com/notWWuhDpr?size=546x752 My project consists of three key components: The header A scrollable main panel The footer While it was relatively easy to implement this layout on the web using the code provided in the link above, I ...

Testing a PHP scheduling program is essential to ensure its functionality and effectiveness. Follow

On my codeigniter app, I have a feature that schedules events for specific dates and times in a MySQL database. These events can be scheduled weeks in advance, and there is also functionality to send email reminders and perform other actions when these d ...

How can I display a pre-existing div with a dropdown button?

I have individual div elements for each type of clothing item (shirt, pant, suit) that I want to display when the corresponding service is selected. This means that when I click on one of them, only that specific div will be shown. I am looking for a solut ...

Navigate from the upper left corner to the lower right corner while hovering

Can you animate the movement of an element from the top-left to the bottom-right using CSS transitions like this? #example { width: 40px; height: 40px; background: red; position: absolute; top: 0; left: 0; transition: all 300ms ea ...

The Material UI button shifts to a different row

I need help adjusting the spacing between text and a button on my webpage. Currently, they are too close to each other with no space in between. How can I add some space without causing the button to move to the next line? const useStyles = makeStyles((the ...

Activate Bootstrap 4 modal screen by utilizing ajaxStart and ajaxStop functionality

How can I trigger the modal screen to appear during ajaxStart and disappear during ajaxStop events? Despite trying various solutions found on Stack Overflow, I am still unable to achieve the desired functionality. Below is the Bootstrap 4 modal code snip ...

Images in the center with a div overlay on top

I'm attempting to place a div or span on top of an image that is positioned above another image. Both images are centered and resized to fit. The height of my images is greater than the width, but they are not set at a fixed size. I want the div to pe ...

Can CSS be used for creating unique color combinations?

I am facing a challenge where I have two div elements with different transparent, colored backgrounds that overlap each other. My goal is to find a way to customize the color in the area where these elements overlap. For instance, if I blend red and blue ...

Using HTML and CSS, we can achieve a fixed position using the `position: sticky`

On my website, I have elements that utilize transformations. One issue I've encountered is that these transformations end up resizing the viewport. Normally, I would address this by setting overflow-x: hidden for both html and body, but doing so disru ...

An HTML table featuring rows of input boxes that collapse when the default value is not filled in

My table is populated with dynamic rows of input boxes, some of which may have a default value while others return an empty string ''. This causes the table to collapse on those inputs. <tr *ngFor="let d of displayData"> < ...

Activate all chosen CSS circles

I'm currently working on creating a progress bar using CSS circles. The idea is that when you click on each circle in sequence (1, 2, 3), all three circles and the line connecting them will fill up with red color. If you then go back (3, 2, 1), the co ...