The issue of cell padding not being effective on a table cell containing a progress bar

I am currently facing an issue with a bootstrap progress bar in my table cells. The table appears to have excessive padding at the bottom, causing it to be taller than necessary.

My goal is to eliminate the padding at the bottom of the cells. I attempted to reduce the size of the progress bar and set the cell padding to 0px, but it did not achieve the desired outcome. How can I reduce the extra space at the bottom of the table cells?

     .progress {
        height: 10px;
    }
        .table > tbody > tr > td{
          padding-top: 2px;
      padding-bottom: 0px;

        }

<table cellspacing="0" cellpadding="0" class="table table-striped">
  <tbody>
    <tr>
      <th>Progress</th>
      <th>CustomerID</th>
      <th>Name</th>
    </tr>

    <tr>
      <td>
        <div class="progress">
          <div id="10010" class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width:20%;"> </div>

        </div>
      </td>
      <td>NYC</td>
      <td>123</td>

    </tr>

    <tr>
      <td>
        <div class="progress">
          <div id="10012" class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="width:30%;"> </div>

        </div>
      </td>
      <td>CT</td>
      <td>1001</td>

    </tr>

    <tr>
      <td>
        <div class="progress">
          <div id="10013" class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width:50%;"> </div>

        </div>
      </td>
      <td>ME</td>
      <td>10013</td>

    </tr>


  </tbody>
</table>

jsfiddle

I have tried adjusting the progress bar and cell padding to remove the extra space, but it is not working as expected. Can you please provide guidance on how to resolve this issue?

Answer №1

The .progress class has a margin-bottom of 20px

.progress {
    height: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

You can change this by adding the following in your own CSS

.progress {
    margin-bottom: 0;
}

Answer №2

To improve the appearance, consider removing the bottom margin from the progress class:

.progress {
    margin-bottom: 0;
}

Check out this link for more information: https://jsfiddle.net/czcz/z6skp8nx/

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

How can I create a custom AppBar transition using Material-UI?

Is there a way to incorporate transitions into the AppBar element within Material-UI? I have tried adjusting the class properties, but unfortunately, I'm not seeing any animation. Can anyone pinpoint what the issue might be? To see the code in action ...

Continuous Div Carousel with Looping in jQuery

I have developed a basic carousel to cycle through a series of divs, but I am facing some issues. I want the carousel to loop continuously so that after reaching "slide 07," it goes back to "slide 01." Unlike using a carousel plugin, I prefer having an ove ...

Dividing HTML and JavaScript using Vue

Is there a way to separate HTML from data/methods in VueJS to avoid having one long file with both? I tried moving the contents of my <script> section into a new file called "methods.js" and importing it using: <script src="methods.js"> Note ...

The event listener for changing radio buttons

Imagine we have two radio buttons <input type="radio" value="val1" name="radio1" onChange="change()"/> <input type="radio" value="val2" name="radio1" onChange="change()&quo ...

Illuminated container with shading

I'm struggling to style a box with a unique glow effect and shadow at the bottom. I've hit a roadblock in creating this particular effect. The glow effect I am aiming for is shown here: https://i.stack.imgur.com/i2va8.png My attempts to create ...

Is it necessary to set required input if the db column can be NULL?

Is there a way to dynamically add the "required" attribute (HTML5) to an input if the chosen column cannot be null in PHP? Here's an example of what I'm trying to achieve: $result = mysqli_query($db, "SELECT * FROM table"); while($row = mysqli ...

Creating PDFs using Puppeteer in the presence of `link` tags

On my website, students have the ability to create their own notes using a RichText editor where the content can be quite complex. I want to provide them with an option to download these notes as a PDF file. To achieve this, I am planning to use the "puppe ...

What is the best way to vertically center a caption when an image is being hovered over

I'm facing an issue with aligning my caption vertically inside a div when hovering. The image within the div is larger than the div, and I want the caption to be at the center of the div. HTML <div class="container-fluid"> <div id="pag ...

What is the significance of vendor prefixes in the world of CSS3?

While I can see the rationale behind using prefixes for experimental non-official features to avoid conflicts, what is the reason for using them on shadows and similar elements? Shouldn't all vendors be implementing effects consistently according to ...

When the md-menu is clicked, the Top Nav shifts upwards along with the mdDialog buttons

Currently, I am in the process of developing a website using AngularJS and ASP.NET, incorporating Angular Material. However, I encountered an issue where scrolling on the page causes the top navigation to move up the body or essentially "disappear" when cl ...

What steps can I take to ensure that a user only clicks on my voting link once for a specific post?

I am managing a MySQL database with two tables. One table is named 'users' with the column 'uname' as the primary key, which stores usernames as strings. The second table is named 'posts' with the column 'id' as the ...

Using a personalized font in CSS isn't functioning correctly and is displaying Times New Roman instead

I've been struggling to include a custom font in my project, but it's not working as expected. Here's how I added it to the .css file: @font-face { font-family: 'Open Sans'; src: url('/open-sans.eot'); src: u ...

Is there a way to extract just the src attribute from an Image tag using PHP?

Similar Question: How can I extract img src, title and alt using php? <img width="200" height="300" src="http://runapvo.apivo.com/files/2011/06/2444-200x300.jpg" class="attachment-medium" alt="2444" title="2444" /> Given the image tag abov ...

Dropdown menu will appear when you click on one of the menu items

Can someone help me create a dropdown menu using a JavaScript function that toggles on click? I've attempted to do so with the following code, but it's not working as expected. Could you please point out where I might be going wrong? I'm loo ...

Ways to display a checked or unchecked checkbox in react depending on a boolean value obtained from an API

Is there a way to display a checked or unchecked checkbox in react jsx depending on a boolean value retrieved from an api? ...

Excessive Empty Area beneath <td>

I'm currently working on creating an e-book and I have encountered a concerning issue. The <figure> and <figcaption> elements are appearing as unknown tags in Sigil. To work around this problem, I decided to use a <table> for display ...

Ensure that the display is set to block to stack the input elements on top of each other

I am attempting to grasp the functionality of CSS display property and experimented with this basic HTML code: <div> <form className="container" action=""> <input name="fName" placeholder="First Name" type="text" value={props.fNam ...

Hidden menu does not work with Jquery

As I work on creating a responsive website, I am faced with the challenge of implementing a menu that only opens on mobile devices when clicked. I came across some code on Stackoverflow that I thought would solve this issue for me. However, I seem to be en ...

Having issues with the functionality of my radio button in AngularJS

As I delve into Angular and experiment with some code, I am focusing on implementing the following functionality: 1. Depending on the user's preference for adding additional details, they can choose between 'yes' or 'no' using radi ...

"Steady layout of grid for the navigation bar and

Currently, I am in the process of developing a control panel with the use of HTML and CSS. To structure the page, I opted for a grid layout. However, I encountered an issue where the navbar and sidebar do not stay fixed on the screen despite trying various ...