Unable to fill the entire wrapper, the Bootstrap table-responsive remains incomplete

As far as I know, the correct way to utilize bootstrap's table-responsive feature is by enclosing it within a div with the table-responsive class:

<div class="table-responsive">
 <table class="table">
 </table>
</div>

However, when attempting to apply CSS to it, I'm unsure if I should target <table> or

<div class=table-responsive>
. When applying styles to <table>, they don't seem to affect it correctly (the table layout from the div still shows; for example, coloring the table background doesn't align borders properly). So, I experimented with styling the div instead. This approach seems to work well, but it results in an unwanted additional layer appearing on my table (IMG_
table ends at *Não Urgentes* row
)
.

Therefore, the question arises - where should I apply styles to the table and how can I do so without affecting the div?

Demo https://jsfiddle.net/e8Lz10td/

Answer №1

The .table class has a margin-bottom, so remember to include <tbody> just once and put all body content inside it.

Answer №2

To make a table responsive, simply insert the class table-responsive within the div and apply it again to the <table>. For more visual guidance, check out this image: https://i.sstatic.net/qM4zx.png

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

sending a value from HTML to jQuery

I'm attempting to send a parameter from HTML to jQuery, but I seem to be getting the same answer each time even though I'm using a for loop in my PHP file like this: for ($x = 0; $x < $length; $x++) { echo "<button ><a class=' ...

Looking to activate a button only when the checkbox is selected and in an enabled state

I'm struggling to make the button enable when the checkbox is checked and enabled. Additionally, it should be dependent on the textarea scroll above it. Once the checkbox is checked, the page needs to scroll up and down to activate the button. Here& ...

What are some methods to implement overflow:hidden for stacked images inside a div?

I currently have two images stacked on top of each other within a div element as shown below: <div class="container"> <img src="somepic.jpg" class="layer" /> <img src="otherpic.jpg" class="layer" /> </div> Styling is set u ...

The ValidationEngine fails to validate a dynamically generated form

After dynamically creating a form, the validationEngine stops working. $(window).load(function($) { var form = document.createElement('form'); form.setAttribute('id', 'xform'); var lbl_usr = do ...

Trouble with image size transition not functioning properly

When attempting to enlarge an image with a transition in Chrome, it doesn't seem to be working properly. Here is the HTML code: <img src="foobar.png"> And the CSS code: img { float: left; margin-right ...

The JS content failed to load into the HTML page

I need help creating a workout tracker using two JS files. The main.js file is responsible for loading content from the second file (workoutTracker.js) into the index.html. However, I'm facing an issue where the content is not being displayed on the p ...

"The functionality of the Bootstrap4 tab panel is not working properly for switching

I am currently working on creating 4 tab panels using Bootstrap 4. My goal is for the tab contents to fade in when I click on them. However, I am facing an issue where nothing happens when I click on the other panels. Do you have any insights on why this ...

Creating a dynamic animation for a navigation bar's underline

I'm attempting to add a smooth underline effect to the links in my navbar when they are hovered over. Unfortunately, the entire ul element is being underlined instead of just the selected link. Is there a way to resolve this issue? a { text-deco ...

Struggling to set up a vertical grid using CSS in Bootstrap 3

Currently in the process of working on my final project as a student. Utilizing Bootstrap 3, I am striving to construct a grid that mirrors the structure depicted in the image below: Thus far, I have only achieved success in creating grids that span hori ...

Setting all lines within a textarea to have indentation

Can individual lines in a textarea be indented? I am using a handwritten font and the first letter on each line is getting clipped slightly. I have tried using padding and margin, but it has not solved the issue. Any suggestions? Thank you. Regards, Erik ...

Arranging particular placement

How can I position my links to the right of the second photo (opus1) and slightly below the first photo (coverPhoto)? I've tried various methods but haven't found a simple solution yet. <!DOCTYPE html> <html lang="en"> <head ...

Guide on how to show an icon in Meteor when a link is clicked

Is there a way to display a viewed icon upon clicking a link in Meteor? On my list of jobs page, when a user clicks on a job, they are taken to the description page. I would like to add an icon to the post indicating that the user has viewed it. ...

Place a div box beneath another div box that is absolutely positioned, without requiring knowledge of its height

My website features an arrangement of pictures placed within div boxes and positioned absolutely to my liking. .char1 - .char5 are correctly positioned. Now, I am seeking a way to align .char6 - .char10 directly under .char1 - .char5. Is there a smart app ...

"Transitioning from Bootstrap version 3.3.7 to the latest Bootstrap version 4.1.3

Everywhere I look, it says that Bootstrap 4.1 is compatible with Bootstrap 3, but when I update my project to the newer version, a lot of things stop working, such as this cookie consent feature. @{ Layout = ""; } @using Microsoft.AspNetCore.Http ...

Display line numbers in HTML/CSS cellsorIncor

Attempting to include row numbers in HTML/CSS. Below is the HTML code with React populating the rows: <table className="table table-striped"> <thead> <tr> {/*<th>ID</th>*/} ...

Enlarging an image on canvas and creating a repeating pattern

My canvas size is 500px x 500px. I have a png image that matches the canvas size, which you can view here. I am looking to resize the image to 100px x 100px and then use it as part of a repeat pattern on the canvas. This is how I achieve this: // First d ...

Achieving dynamic HTML element addition through JavaScript while maintaining their record in PHP

There is an input box where the user specifies the number of new DIV elements to be added dynamically. This request is then sent to PHP via Ajax, where it prepares an HTML DIV with some inner input tags. Each DIV has a unique id attribute generated increme ...

How can I ensure that the image fits perfectly within the box using HTML and CSS

I'm having trouble displaying an image perfectly within my div. The image doesn't cover the entire box. Here is my code: .card-background{ background-image: url("../../../assets/imgs/back-blank.png"); border-radius: 10px; margin-top: 2%; ...

Unable to generate a menu with bootstrap

Hey there, I've been experimenting with creating a responsive menu using Bootstrap, but I'm struggling with the implementation. My vision is to have a logo on the left side and a menu on the right side. Below is the concept for my menu design. ...

Attempting to create a functional action listener for a deck of cards game

I'm currently working on a game and want to make an image appear blank when clicked on, to simulate it disappearing. Specifically, this is for a tri peaks solitaire game. I have a function that tests the validity of playing a card, but I'm strugg ...