The issue arises when trying to style a scrollable table in Bootstrap with CSS

I have created a scrollable table using Bootstrap. The scrolling functionality works perfectly, but I am facing an issue with three black lines appearing under the thead tag. I am unsure how to remove them. If you have any suggestions on how to fix this problem, I would greatly appreciate your help.

This table is designed for Persian language, and I have sorted the td tags in a specific way. If there is a better way to achieve the desired outcome, I would be thrilled to receive assistance.

HTML code:

<div class="container py-5" dir="rtl">
                        <div class="row">
                            <div class="col-lg-12 mx-auto bg-white rounded shadow">
                
                                <!-- Fixed header table-->
                                <div class="table-responsive">
                                    <table class="table table-fixed table-bordered table-hover table-striped">
                                        <thead>
                                            <tr class="bg-light table-success">
                                                <th scope="col" class="col-2"> پرونده</th>
                                                <th scope="col" class="col-2">عملیات</th>
                                                <th scope="col" class="col-2">شماره ملی</th>
                                                <th scope="col" class="col-2">نام پدر</th>
                                                <th scope="col" class="col-2">خانوادگی</th>
                                                <th scope="col" class="col-1">نام</th>
                                                <th scope="col" class="col-1">عکس</th>
                                    
                                            </tr>
                                        </thead>
                                        <tbody >
                                            // Table body content here...
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>

CSS code:

.table-fixed tbody {
  height: 300px;
  overflow-y: auto;
  width: 100%;
}

.table-fixed thead,
.table-fixed tbody,
.table-fixed tr,
.table-fixed td,
.table-fixed th {
  display: block;
}

.table-fixed tbody td,
.table-fixed tbody th,
.table-fixed thead > tr > th {
  float: left;
  position: relative;
}
.table-fixed tbody td::after {
  content: "";
  clear: both;
  display: block;
}
.table-fixed tbody th::after {
  content: "";
  clear: both;
  display: block;
}
.table-fixed thead > tr > th ::after {
  content: "";
  clear: both;
  display: block;
}

Answer №1

To eliminate the border width of rows in your CSS, make sure to include the following code snippet:

.table-bordered>:not(caption)>* {
       border-width: 0;
  }

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

What is the process for manually looping an HTML5 video on iOS 4.3/5?

I'm facing an issue with a video that has specific segments I need to be looped. The problem arises on iOS 5, where after updating videoElem.currentTime for the third time, mobile Safari stops recognizing this attribute correctly. Interestingly, on i ...

AngularJS object array function parameter is not defined

Recently, I've been honing my AngularJS1x skills by following tutorials on Lynda and Udemy. One tutorial involved creating a multiple choice quiz. To test my understanding, I decided to modify the code and transform it into a fill-in-the-blank quiz. ...

Tips for ensuring that flex-box children can scroll properly

I'm having trouble getting the content to scroll correctly while dealing with nested flex-box structures. Below is my CSS code: html,body,#root{ width:100%; height:100%; padding:0; margin:0; } .flex-fill{ height:100%; width:100%; ...

Is it possible to dynamically change HTML content by utilizing a JSON file?

Looking to implement a JavaScript loop (using jQuery) that can dynamically populate the HTML file with content from a JSON file based on matching <div> ids to the JSON "id" values. The solution should be scalable and able to handle any number of < ...

Creating a custom blockquote style for a WordPress Twenty Fifteen child theme

Currently, I am creating a new child theme for Twenty Fifteen completely from scratch. The one area I am struggling with is customizing the appearance of the blockquote using CSS. Here is an example of the custom CSS I have added to the blockquotes within ...

Attempting to insert a line break tag within the text using React

Having trouble inserting line breaks in text using React. Can anyone guide me on how to achieve this? I've attempted adding the br tag, but it is displaying as in the browser. Here's a snippet of my code. Appreciate any help or advice. let sp ...

Retrieve specific nested array values in Handlebars based on an index's value

While I understand that this question may have been asked previously, my query pertains to obtaining data in a specific pattern since I am relatively new to Handlebars. Currently, I have some JSON data structured as follows: "value": [ { ...

Filtering, cleaning, and confirming the validity of data input allowed for HTML tags

While there is a lot of information available on sanitizing, filtering, and validating forms for simple inputs like email addresses, phone numbers, and addresses, the security of your application ultimately relies on its weakest link. What if your form inc ...

Disabling the movement of arrows in the client-testimonials-carousel plugin

This plugin that I'm currently using is working flawlessly: However, I'm unsure about how to make the arrows stationary and prevent them from moving. Currently, they are centering themselves based on the height of the div, but I want them to rem ...

Steps for showing the text entered into the input box as soon as it is typed:

I am attempting to create a feature where text is displayed as soon as it is typed into an input box. Currently, my JavaScript function is not working at all. I simply want the function to display text when it is typed into or erased in the text boxes. & ...

Modify the color scheme of the parent div by selecting the child div (using only CSS and HTML)

I am working with a nested div structure, where one is contained inside the other: <div class="outer"> <div class="inner"> </div> </div> It looks something like this: https://i.sstatic.net/r5qbD.png I ...

Embedding a file in a word document with a hyperlink

We are currently trying to access Word documents on our Intranet site. One of these documents contains an Excel Spreadsheet that we would like to directly link to, but we have been unable to find a solution so far. ...

How do you transfer drop-down values from an HTML template to views in Django?

I am trying to figure out how to pass the selected option value in a drop down menu to the views. The HTML code of my template is as follows: <select name="version" id="version" onchange="location = this.value;"> &l ...

Troubleshooting problem with image dimensions when substituting png for svg

Hey there, I've encountered an issue with svg... Currently, I'm utilizing the modernizr script as a backup for older IE versions to switch the svg to a png extension. The hiccup I'm facing is that I'm using widths to manage the svg si ...

HTML videos with Automatic Looping and Autoplay Features

I have attempted to change the settings to true and adjust the order in the hopes that it would resolve the issue. Unfortunately, the videos are still not autoplaying and looping. Although I believe the videos are muted, I have also explicitly muted them ...

Intriguing flashing dark streak, reminiscent of a boundary within NextJS

I have recently encountered an unexpected issue with my full-width video header that worked perfectly on multiple pages before. Strangely, a thin black line has appeared around the bottom and right side of the div (.header) containing the video, even thoug ...

Tips for aligning images directly alongside text without any separation

I'm currently learning html and facing some challenges with coding my own blog page. My main issue is trying to design a section that leads to the latest post, but I can't seem to get the layout right. I envision having the text and image neatl ...

I'm having trouble with Bootstrap 4 where my fixed navbar won't stay separate from my jumbotron

Currently working on a website and utilizing Bootstrap. Looking to keep my fixed navbar distinct from my jumbotron, but struggling to achieve separation between the two. Is there a method to accomplish this without directly modifying the CSS file? Here i ...

The proper method for incorporating a hover effect using CSS

Currently, I am facing an issue with integrating a hover effect to an image using CSS. The problem arises when the hover area is not aligned properly and the effect triggers even when the mouse is not directly over the image. <body> <div id=&apos ...

Guide to showing Bootstrap Offcanvas within a Modal

Can the Offcanvas feature from Bootstrap be displayed within a Modal? Below is the code snippet: <script src="https://cdn.jsdelivr.net/npm/@popperjs/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ccafa3bea98cfee2f5e2fe" ...