The responsiveness of Bootstrap 4 columns is not functioning as expected

Switching from Bootstrap 3 to Bootstrap 4 has introduced some unexpected challenges...

Upon resizing the browser window, the divs start overlapping instead of breaking onto a new row when necessary.

Why is this happening and how can it be resolved?

I've followed the documentation closely, but I'm struggling to understand why this issue persists with Bootstrap 4 (I realize it uses flexboxes).

.first-td-bold tr td:first-child {
  font-weight: bold;
  padding-right: 40px;
}

.no-wrap tr td {
  white-space: nowrap;
}

.no-wrap a {
  white-space: nowrap;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>

<body>
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-2">
        <nav class="nav nav-pills flex-column no-wrap">
          <a class="flex-sm-fill nav-link active" href="#">Alles</a>
          <a class="flex-sm-fill nav-link" href="#">Calculatie</a>
          <a class="flex-sm-fill nav-link" href="#">Opdracht</a>
          <a class="flex-sm-fill nav-link" href="#">Contract</a>
          <a class="flex-sm-fill nav-link" href="#">Meer- minderwerk</a>
        </nav>
      </div>
      <div class="col-md-10">
        <div class="row">
          <div class="col-md-4">
            <table class="table table-striped first-td-bold no-wrap">
              <tr>
                <td>Datum toegevoegd</td>
                <td>05-08-2017</td>
              </tr>
              <tr>
                <td>Bestandsnaam</td>
                <td>179358-Wanden.pdf</td>
              </tr>
              <tr>
                <td>Type</td>
                <td>PDF</td>
              </tr>
              <tr>
                <td>Grootte</td>
                <td>8.642,35 KB</td>
              </tr>
            </table>
          </div>
          <div class="col-md-8">
            <object data="myfile.pdf" type="application/pdf" width="100%" height="100%" style="background: #ddd;"></object>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>

Answer №1

Great news! I believe this solution aligns perfectly with your requirements. You can view the code on CodePen by following this link: https://codepen.io/chris-hitchcock/pen/BPybej

I decided to remove the nested row as it appeared unnecessary for your needs. However, if you find that you need to reinsert it, the process is quite simple. Essentially, I only specified the width of the first column "col-md-2" while leaving the rest as col-md to allow for breaks and content flow. Additionally, I included a slight margin in the first column to prevent overlap with your navbar.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> 
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>

<body>
<div class="container-fluid">
        <div class="row">
            <div class="col-md-2 pad">
                <nav class="nav nav-pills flex-column no-wrap">
                    <a class="flex-sm-fill nav-link active" href="#">Alles</a>
                    <a class="flex-sm-fill nav-link" href="#">Calculatie</a>
                    <a class="flex-sm-fill nav-link" href="#">Opdracht</a>
                    <a class="flex-sm-fill nav-link" href="#">Contract</a>
                    <a class="flex-sm-fill nav-link" href="#">Meer- minderwerk</a>
                </nav>
            </div>
            <div class="col-md">
                <table class="table table-striped first-td-bold no-wrap">
                    <tr>
                        <td>Datum toegevoegd</td>
                        <td>05-08-2017</td>
                    </tr>
                    <tr>
                        <td>Bestandsnaam</td>
                        <td>179358-Wanden.pdf</td>
                    </tr>
                    <tr>
                        <td>Type</td>
                        <td>PDF</td>
                    </tr>
                    <tr>
                        <td>Grootte</td>
                        <td>8.642,35 KB</td>
                    </tr>
                </table>
            </div>
            <div class="col-md">
                <object data="myfile.pdf" type="application/pdf" width="100%" height="100%" style="background: #ddd;"></object>
            </div>
    </div>
</div>
</body>

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

Combine lists with floating elements positioned to the left or right

My HTML includes the following ul tag: <ul style="position:absolute"> <li>list 1</li> <li>list 2</li> <li>list 3</li> <li> list 4 <p>list 4 content goes here</p> ...

Transform every DIV element into a TABLE, replacing each DIV tag with a combination of TR and TD tags

I have a code that is currently structured using DIV elements. However, I've encountered alignment issues when rendering it in EMAIL clients. To address this problem, I am looking to convert the DIV structure to TABLE format. Below is the original co ...

Tips for displaying sub links when hovering over a link

My code can be found at http://jsfiddle.net/ChvjL/4/ I need the sub links link1a, link1b, link1c to appear when the mouse pointer is over Link1. The same functionality should apply for Link2 as well. If anyone can assist me in solving this issue, I woul ...

What are the steps to make the chosen title and its content active while deactivating the others?

I am currently developing a website for an educational institution that includes schools with subdivisions such as matric, CBSE, and state board, as well as a college. My goal is to create a user interface where clicking on a specific stream (such as matri ...

Three-handled slider

Just acquired a new slider component <input id="slider_price" type="text" class="span2" value="" data-slider-min="1000" data-slider-max="80000" data-slider-step="5" data-slider-value="[60000, 80000]"/> _ $('#slider_price').slider({ t ...

How to insert an image into a placeholder in an .hbs Ember template file

I'm looking to enhance a .hbs template file in ember by incorporating an image. I am not a developer, but I'm attempting to customize the basic todo list app. <section class='todoapp'> <header id='header'> & ...

jQuery preventing form submission after returning false

There's a small issue that I need help with. After submitting the form and receiving a false response, it prevents resubmission. For example, if a user forgets to input their name, they will see an error message asking them to do so. However, the u ...

Dragging a hyperlink onto the web browser using jQuery's drag functionality

Seeking a solution for my small script that allows users to drag a link and also drop it onto the browser bar for bookmarking or sharing. How can I achieve this functionality? Check out an example of one of the drag functions I currently utilize: http:/ ...

Using jQuery to retrieve the value of a span element involves a few simple steps

Recently, I have started venturing into the world of jQuery. I have managed to create a form field with text input and included some text within a span element. <div class="input-group" style="width:40%"> <input type="text" name="emial" id= " ...

What is the best way to add a -webkit-transform to a div without affecting its enclosed elements?

Is there a way to apply a webkit transformation to a div without affecting the text inside? I need help with achieving this. Below is my current code: .main_div { width:200px; height:100px; background:red; margin-left:55p ...

Trouble with scrolling on FancyBox2 and Droid 2.3.4

I have encountered an issue with my Droid 2.3.4 where when I view content through iFrame in Fancybox2, scroll bars are not showing up. Despite trying various solutions that I came across, nothing seems to work. Interestingly, all other browsers like iPhone ...

Modifying the parent directive's DOM in response to an event triggered by the child directive

I need help figuring out how to implement a custom radio-buttons list directive in the correct way. Imagine I want to create a directive like this: <my-radio-button-list> <my-radio-button> ...Some HTML content... </my-radio ...

Tips for populating an array with boolean values when a checkbox change event occurs:

I am looking to fill the answers array with boolean values. The checkboxes on my form are generated dynamically, but there will only be four of them. When a checkbox is unchecked, its corresponding value in the answers array should be false; when checked, ...

Issue arises when combining inline-block and overflow-wrap for div elements

I am facing an issue with two divs that look good on the same line when utilizing display: inline-block. However, if one of the containers contains an excessively long word that I attempt to wrap using overflow-wrap and word-break, it causes the container ...

What is the best way to extract text from multiple "div class" (html) elements in R?

My objective is to collect data from this html page in order to build a database: https://drive.google.com/folderview?id=0B0aGd85uKFDyOS1XTTc2QnNjRmc&usp=sharing One of the variables I am interested in is the price of the apartments. I have noticed th ...

Switch up the box-shadow color with ColorThief!

Is there a way to adjust this script to change the box-shadow color of #player1? <script type="text/javascript> $(window).ready(function(){ var sourceImage = document.getElementById("art"); var colorThief = new ColorThief(); var color = ...

Creating a custom colored progress bar in Angular 2 using Bootstrap 4

I've been working on implementing a bootstrap progress bar with ng-bootstrap components. The documentation outlines 4 preset coloring options using the directive "type": "success", "info", "warning", or "danger". () To customize the colors, I made ad ...

How to Align Printed Output in Angular Components

I am a beginner in Angular and I am looking to display modal information. To print the data, I am using onclick=print(). The data shows up in the print preview, but it is not aligned correctly. Here is a screenshot of my page. I want to align the data prop ...

Tips for looping through a Map with ngFor in Angular 2+ and showing the elements in a specific order on an HTML page

Currently, I am utilizing Angular 7.x for my project. I have successfully incorporated code that utilizes *ngFor to iterate over a Map and display the data on an HTML page. <mat-list-item *ngFor="let data of map | keyvalue"> <div ...

Different ways to modify the underline and label color in Material-UI's <Select/> component

A while ago, I came across this useful demo that helped me change the colors of input fields. Here is the link: https://stackblitz.com/edit/material-ui-custom-outline-color Now, I'm on a quest to find a similar demo for customizing the color of selec ...