Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

thead-dark not work in angular project using bootstrap

I try to add thead-dark into my table but is does not work. I'm using bootstrap.

My code:

<table class="table">
    <thead class="thead-dark">
        <tr>
            <th>Name</th>
            <th>Price</th>
            <th>Units In Stock</th>
        </tr>
    </thead>

Bootstrap :

....
  <meta name="viewport" content="width=device-width, initial-scale=1">  
  <!-- Bootstrap CSS -->
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
....

It's last version of bootstrap not support thead-dark?

How to proceed?

like image 575
mester smith Avatar asked Feb 07 '21 19:02

mester smith


Video Answer


2 Answers

Can you please check the below code? Hope it will work for you. In latest version of bootstrap, we can use "table-dark" class instead of "thead-dark". You can use "table-dark" class in thead, tr, and td also.

Please refer to this link: https://jsfiddle.net/yudizsolutions/qomrf9pk/

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">

<table class="table">
  <thead class="table-dark">
    <tr>
      <th>Name</th>
      <th>Price</th>
      <th>Units In Stock</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Demo Name</td>
      <td>500</td>
      <td>50</td>
    </tr>
  </tbody>
</table>
like image 52
Yudiz Solutions Avatar answered Nov 15 '22 10:11

Yudiz Solutions


<table class="table">
  <thead class="table-dark">
    ...
  </thead>
   <tbody>
   ...
  </tbody>
</table>

Demo

like image 40
Abbas roholamin Avatar answered Nov 15 '22 11:11

Abbas roholamin