The Bootstrap table extends to the side menu and ends up with an odd width

Having trouble getting the table and side menu to behave properly within bootstrap columns, as shown in the image. I've tried various solutions with no success. The goal is to have a responsive table that fills 7 columns and a side menu that fills 3 columns. Any insights on why the table is impacting other content layout would be appreciated.

Your assistance is greatly appreciated!

Image

.vertical-menu {
    font-family: 'Roboto';
}

.vertical-menu a {
    background-color: #eee; 
    color: black; 
    display: block; 
    padding: 12px; 
    text-decoration: none; 
}

.vertical-menu a:hover {
    background-color: #ccc; 
}

.vertical-menu a.active {
    background-color: #4CAF50;  
    color: white;
}

#coin{
 text-align: center; 
 background-color: #343434;
 color: #FFF;
 padding: 10px;
 margin: 0;
 border-top-right-radius: 12px;
 font-family: 'Roboto';
}

.main {
display:inline-block;
height: auto;
}

.content {
}

.table {
width: 800px;
}

.main h3 {
margin-left: 390px;
font-family: 'Roboto';
margin-top: 40px; 
}
<div class="main">
<div class="row">
<div class="col-md-3">

<div class="vertical-menu" >
<h5 id="coin">Coins</h5>
  <a href="#" class="active">BTC</a>
  <a href="#">BitC</a>
  <a href="#">Eth</a>
  <a href="#">LightC</a>
  <a href="#">iota</a>
  <a href="#">ripple</a>
  <a href="#">Verge</a>
  <a href="#">Cardano</a>
  <a href="#">NEM</a>
  <a href="#">TRON</a>
  <a href="#">Dash</a>
  <a href="#">EOS</a>
  <a href="#">NEO</a>
  <a href="#">Monero</a>
  <a href="#">Qtum</a>
</div>
</div>
<div class="col-md-9">
<h3>Bitcoin</h3>


<table class="table table-hover table-responsive">
  <thead>
    <tr>
      <th>#</th>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Username</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>
</div>
</div>
</div>

Answer №1

enclose it within a div with the class of table-responsive

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

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

Footer content spilling out of the wrapper div

My web page has a footer content that is overlapping the wrapper div due to some issues with my css and html. Even when I tried changing the height to auto, it didn't resolve the problem. Below is an example of the current state of the page I am worki ...

Creating the perfect layout with CSS: A step-by-step guide

As I work on refining my layout to achieve the desired look, let me share my initial idea before delving into the issue at hand. Currently, I am attempting to create something similar to this: https://i.stack.imgur.com/rtXwm.png This is how it appears a ...

What are the steps to create a horizontal submenu in WordPress?

Is there a way to change the default vertical sub menu of my main menu to horizontal? The CSS for the sub menu in stylesheet.css is as follows: .main-nav>ul>li .sub-menu> li { padding:0 20px; } .main-nav>ul>li .sub-menu> li:first-ch ...

Displaying a table in Chrome/Firefox with a mouseover feature

Hovering over the rows of this table triggers a display of descriptions. html: <tr title="{{transaction.submissionLog}}" class="mastertooltip">... JavaScript: $('.masterTooltip').hover(function(){ // Hover functionality ...

Sending JSON-encoded data using HTML5 Server-Sent Events (SSE) is a

I have a script that triggers an SSE event to fetch json encoded data from online.php. After some research, I discovered methods for sending JSON data via SSE by adding line breaks. My question is how to send JSON through SSE when the JSON array is genera ...

Creating responsive data tables in HTML

My e-shop features a product description block using the code snippet below. While it looks great on larger screens, such as a 17" desktop monitor, it appears poorly on smaller smartphone screens. Friends have suggested that I learn Bootstrap/Flexbox and ...

Full-screen background with image adhering perfectly - left-aligned button that stays in place

Excuse me if my question seems basic, as I am just starting out in front-end development and may not know all the necessary terms to fully understand existing questions. I currently have a simple html file that consists of a title and three buttons, with ...

Is the WordPress error message "wp_register_style was improperly called" showing up on

I am facing an issue while trying to incorporate this code into my initial Wordpress template. It seems that the libraries for Bootstrap and my custom styles are not functioning as expected. Here is the code snippet in question. Any insights would be great ...

The powers of jQuery and CSS selectors

Previously, I utilized the following code to extract text from the data-placeholder attribute and apply it as a placeholder for my div. [contentEditable=true]:empty:not(:focus):before { content:attr(data-placeholder) } While this method worked well b ...

Eliminate :hover effects from the :after elements' content

I am trying to eliminate the hover effect from the content inserted using the css selector :after. Below is my code where I want to remove the underline hover effect from > HTML <ul class="path_string_ul"> <li>Home</li> <l ...

The row does not completely occupy the entire width of the container

My goal is to design a container using Bootstrap. I have successfully added a name and button at the top of the container as a row, set a background color, and included a border. However, there seems to be an issue with the width of the border compared to ...

Showcasing a glTF/glb model using three.js in hugo

For my personal website, I am using Hugo with the coder theme. My goal is to showcase a glTF/glb model as the avatar on the home page. I have successfully created an index.html file where I can display a glTF/glb model standalone (without Hugo). <!DOCTY ...

I am facing an issue where the text within my div element is not displaying as expected

My carousel is designed like this: I am having trouble displaying my labels correctly. This is an example of how I create one of my boxes: <div class="tl-box-wrapper"> <div class="tl-box"> <div class="tl-top"> <i class= ...

Generate a circular shape wherever the mouse is moved

I'm currently working on implementing a custom mouse trail using temporary divs. These divs are supposed to appear at the location of the mouse and then fade out after a short period. However, I've run into an issue where the divs only appear at ...

Is there a way to ensure that the border of a textarea matches the border of a text input?

My goal is to make the textarea fields in my form have the same appearance as the text input fields, regardless of the browser being used. I am interested in achieving this without imposing a customized style, but instead by leveraging the standard style w ...

What steps can I take to verify that all textboxes are filled and checkboxes are selected before allowing the user to submit the form?

Here is the JavaScript code and a snippet of the HTML that I am using to create a form. I am having trouble figuring out why the form can still be submitted even when there are empty fields. Ideally, a dialog box should pop up indicating which fields nee ...

Organize your blog content by utilizing post IDs as the designated id attribute

What is the best way to format blog posts and comments in HTML so that I can easily manipulate them later using jQuery/Javascript for tasks like updating, deleting, or making Ajax calls? I am considering using the IDs (primary keys in the database) of the ...

Having trouble viewing the CSS menu on Internet Explorer 8? Could it be a potential JavaScript issue causing the problem?

Receiving complaints about the menu bar dysfunction in Internet Explorer 8 has left me bewildered. Despite working perfectly on all other browsers and earlier versions of IE, I cannot figure out what's wrong with the code. You can view the website at ...

Looking for the optimal width ranges for media queries on laptops and cell phones?

Can anyone suggest the optimal width parameters to use in my code for different screen sizes, from tablets and laptops to cellphones, in order to create a responsive design? ...

In React, I'm unable to navigate to a different page

My English may not be the best, but I am working on creating a Login Page. The issue I'm facing is that when I click the Login button, I want to navigate to the Home Page I designed using React. However, whenever I try to implement Link or Route comma ...