PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 2, 2022

[FIXED] How can I remove the thick line from the table header row bottom

 August 02, 2022     bootstrap-5, html-table, react-bootstrap, reactjs     No comments   

Issue

I just follow the example for creating a table with the bootstrap Table element.

Here is my StackBlitz, I wonder why a thick black line exists at the bottom of the table header.

However, the example site does not have a thick black line exists at the bottom of the table header.

Is there something wrong? is it possible to remove the thick black line from the bottom of the table header?


Solution

It is border assigned by bootstrap when you use Table group dividers. See Bootstrap docs for more details.

To get remove it add borderTop: 'none' to tbody. So updated component looks like below

import React from 'react';
import Table from 'react-bootstrap/Table';
export default function App() {
  return (
    <div className="m-4">
      <Table striped bordered hover>
        <thead>
          <tr>
            <th>#</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Username</th>
          </tr>
        </thead>
        <tbody style={{ borderTop: 'none' }}>
          <tr>
            <td>1</td>
            <td>Mark</td>
            <td>Otto</td>
            <td>@mdo</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Jacob</td>
            <td>Thornton</td>
            <td>@fat</td>
          </tr>
          <tr>
            <td>3</td>
            <td colSpan={2}>Larry the Bird</td>
            <td>@twitter</td>
          </tr>
        </tbody>
      </Table>
    </div>
  );
}


Stackblitz Reproduction: https://react-ue5ckm.stackblitz.io



Answered By - Pavan Jadda
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing