Please provide unique text to be rewritten

My bootstrap row consists of 4 columns (col-lg-3). One of the columns contains a tab-content element. The issue is that when I click on the next tab, the content overflows the box and does not render within the div width as intended.

I've attempted to add style="width:200px" to all the div containers within this column, but none of them adjust properly when I switch tabs.

https://i.sstatic.net/Ulynj.png

Tab Content Code:

            <div class="col-lg-3 align-items-stretch">
                    <div class="card">
                        <div class="card-header bg-14">
                            <h2><?php echo $lang_top_airlines ?></h2>
                        </div>
                            <div class="card-body">


                            <div class="tab-content" id="nav-TopAirlines" style="width:250px">

                                    <div class="tab-pane fade show active" id="nav-airlines-flights" role="tabpanel" aria-labelledby="nav-airline-flights">
                                        <?php 
                                            $path = $_SERVER['DOCUMENT_ROOT'];
                                            $path .= "/includes/connections/mysqli.php";
                                            require($path);

                                            $sql = "SELECT count(*) as countLVM, lvm.luchtvaartmaatschappij AS naam, lvm.IATACode
                                                    FROM tbl_vluchtgegevens vg

                                                    LEFT JOIN tbl_luchtvaartmaatschappij lvm
                                                    ON vg.luchtvaartmaatschappij = lvm.luchtvaartmaatschappijID

                                                    WHERE vertrekdatum2 <=NOW()

                                                    GROUP BY lvm.luchtvaartmaatschappij
                                                    ORDER BY countLVM DESC
                                                    LIMIT 10";

                                            $dataAF = $link->query($sql);
                                            $dataPointsAF = array();

                                            if ($dataAF->num_rows > 0) {

                                                while($rowAF = $dataAF->fetch_assoc()) {
                                                     $pointAF = array("label" => $rowAF['IATACode'], "y" => $rowAF['countLVM'], "name"=> $rowAF['naam']);
                                                    array_push($dataPointsAF, $pointAF);
                                                }
                                            }
                                            $link->close();        

                                            ?>

                                            <div id="TopAirlinesFlights" style="width: 200px; height: 300px;"></div>
                                    </div>

                                    <div class="tab-pane fade" id="nav-airlines-distance" role="tabpanel" aria-labelledby="nav-airline-distance">
                                        <?php 
                                            $path = $_SERVER['DOCUMENT_ROOT'];
                                            $path .= "/includes/connections/mysqli.php";
                                            require($path);

                                            $sql = "SELECT lvm.luchtvaartmaatschappij AS naam, lvm.IATACode, SUM(vr.afstand) as SumDistance
                                                    FROM tbl_vluchtgegevens vg

                                                    LEFT JOIN tbl_vliegroutes vr
                                                    ON vg.vertrekluchthaven = vr.vertrekID
                                                    AND vg.aankomstluchthaven = vr.aankomstID

                                                    LEFT JOIN tbl_luchtvaartmaatschappij lvm
                                                    ON vg.luchtvaartmaatschappij = lvm.luchtvaartmaatschappijID

                                                    WHERE vg.vertrekdatum2 <=NOW()

                                                    GROUP BY lvm.luchtvaartmaatschappij
                                                    ORDER BY SumDistance DESC
                                                    LIMIT 10;";

                                            $dataAirD = $link->query($sql);
                                            $dataPointsAirD = array();

                                            if ($dataAirD->num_rows > 0) {

                                                while($rowAirD = $dataAirD->fetch_assoc()) {
                                                    $pointAirD = array("label" => $rowAirD['IATACode'], "y" => $rowAirD['SumDistance'], "name"=> $rowAirD['naam']);
                                                    array_push($dataPointsAirD, $pointAirD);
                                                }
                                            }
                                            $link->close();        

                                            ?>


                                            <div id="TopAirlinesDistance" style="width: 200px; height: 300px;"></div>
                                    </div>
                                </div>



                                <nav>
                                    <div class="nav nav-fill nav-pills" id="nav-airline" role="tablist">
                                        <a class="nav-item nav-link active" role="tab" id="nav-airline-flights" data-toggle="tab" href="#nav-airlines-flights" aria-controls="nav-airlines-flights" aria-selected="true"><i class="fas fa-plane-departure"></i>&nbsp;&nbsp;by Flights</a>
                                        <a class="nav-item nav-link" role="tab" id="nav-airline-distance" data-toggle="tab" href="#nav-airlines-distance" aria-controls="nav-airlines-distance" aria-selected="false">
                                            <i class="fas fa-map-marked-alt"></i>&nbsp;&nbsp;by Distance</a>
                                    </div>
                                </nav>


                            </div>
                    </div>
                </div>

Javascript Code Section:

<script type="text/javascript">
    $(function () {

        CanvasJS.addColorSet("blueShades2",
                        [       
                            "#074b83",  
                            "#085a9d",  
                            "#0a69b7",
                            "#0b78d1",
                            "#0c87eb",
                            "#2196f3",
                            "#4daaf6",
                            "#79bff8",
                            "#a6d4fa",
                            "#d2eafd"
                        ]);

    var TopAirports = new CanvasJS.Chart("TopAirports", {
        zoomEnabled: false,
        axisX:{ 
            reversed:  true
            },
        animationEnabled: true,

        colorSet: "blueShades2",

        toolTip:{content: "{name}: {y}"},
        data: [{
            type: "bar",
            indexLabelFontSize: 14,
            indexLabel: "{y}",
            indexLabelPlacement: "outside",  
            indexLabelOrientation: "horizontal",
            dataPoints: <?php echo json_encode($dataPointsTA, JSON_NUMERIC_CHECK); ?>
             }]
    });


    var TopAirlinesFlights = new CanvasJS.Chart("TopAirlinesFlights", {
        zoomEnabled: false,
        animationEnabled: true,
        colorSet: "blueShades2",
        axisX:{ 
            reversed:  true
            },
        toolTip:{content: "{name}: {y}"},
        data: [{
            type: "bar",
            indexLabelFontSize: 14,
            indexLabel: "{y}",
            indexLabelPlacement: "outside",  
            indexLabelOrientation: "horizontal",
            dataPoints: <?php echo json_encode($dataPointsAF, JSON_NUMERIC_CHECK); ?>
             }]
    });


    var TopAirlinesDistance = new CanvasJS.Chart("TopAirlinesDistance", {
    zoomEnabled: false,
    animationEnabled: true,
    colorSet: "blueShades2",
    axisX:{ 
        reversed:  true
        },
    toolTip:{content: "{name}: {y}"},
    data: [{
        type: "bar",
        indexLabelFontSize: 14,
        indexLabel: "{y}",
        indexLabelPlacement: "outside",  
        indexLabelOrientation: "horizontal",
        dataPoints: <?php echo json_encode($dataPointsAirD, JSON_NUMERIC_CHECK); ?>
         }]
});


    TopAirlinesFlights.render();
    TopAirports.render();
    TopAirlinesDistance.render();
    });


    </script>

Answer №1

When setting the width to be 200px, remember to use: max-width:200px.

Utilize Media Queries to continuously adjust the max-width value as the screen size varies. Failing to do so will cause it to remain fixed at 200px regardless of the screen size changes.

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

Acquiring the PayPal callback variable with PHP

When using PayPal Standard HTML form, upon completion of the transaction, the user is directed to the return URL. To retrieve variables such as the user email, order number, and other available information using PHP, I need to utilize the GET method from t ...

arrangement of semantic-ui icon placement

Currently tackling a project and could use some assistance with positioning an icon in the upper right corner of my page. I've been trying different approaches without much success. The icon is from semantic-ui. import React from 'react' im ...

Issue with applying Jquery toggleClass to an element

I'm encountering an issue with applying a toggleClass that is not working to add the new class. Can someone help me understand what's happening? <a href="#" id="cf_onclick">Click</a> <div id="main" class="invisible"> Hi there ...

Experiencing difficulty saving information from an HTML file due to an unexpected error in the browser

My website project includes a registration form to gather user data. I wrote the JavaScript code that should store this data when the user clicks on the sign-up button. Here is a snippet of my HTML: <input type="text" class="loginInfo& ...

Using Twig: Transfer the content of a textfield as a parameter in the routing

I have a task of redirecting to another page while passing along the value from a textfield. Here is my current code: {% extends "base.html.twig" %} {% block body %} <button onclick="host()">Host the session</button> <button onclic ...

Angular 4 Integration with Bootstrap V4 Dropdown

When working with Angular 4 and using Bootstrap V3 for Dropdown implementation, we utilize the "Open" class to show the dropdown menu upon clicking. I'm curious if there is a specific class in Bootstrap V4 that achieves the same effect when clicking o ...

Manage Raspberry Pi through a local website

Seeking guidance on creating a system where pressing a button on a webpage triggers a signal to a raspberry pi. For example, clicking on button1 on my laravel-built website initiates operation1 on the raspberry pi side, which will be using a .Net App. An ...

Efficiently passing parameters to AJAX URLs in Django

When trying to pass a parameter to the URL path to specify which user's role I want to change, I keep encountering an error. NoReverseMatch at /manageuser/ Reverse for 'editrole' with keyword arguments '{'user_name': &apo ...

Is it possible to rearrange an array by moving an element to the front

If I have an array as shown below, how can I move key [2] and its corresponding value to the front of the array? This would make it key [0] and increment the other keys by 1. Current: [0] => Array ( [name] => Vanilla Coke cans 355ml x 2 ...

How can I make CSS/HTML tables display inline until they are wider than the parent div?

Is there a way to position two tables next to each other until one table grows wider than the set minimum width, and then have the second table appear below the first, with both tables centered within their parent <div>? This is the current setup: ...

Execute a sudo command using an html button

Looking for a way to create a simple website with HTML buttons on my Raspberry Pi that can execute sudo commands. I attempted the following method: <?php if (isset($_POST['button'])) { exec('sudo reboot'); } ?> ...

Websites experiencing horizontal scrolling functionalities

I have noticed that in my angular project, the website becomes horizontally scrollable when I log in. This only happens after logging in, and does not occur beforehand. I'm using angular calendars and Bootstrap for styling. What could be causing this ...

Switch Between Different Background Colors for Table Rows With Each Click

This script changes colors when a row in a specific column is clicked: $(document).ready(function(){ $("#rowClick").children("tbody").children("tr").children("td").click(function(){ $(this.parentNode).toggleClass("enroute"); }); }); CSS: .placed{ b ...

Flipping and expanding cards with CSS3

I am attempting to create a layout with a collection of cards/divs within a container. When a card/div is clicked, it should flip horizontally and expand to occupy the entire space within the container (essentially resizing to 100% x 100% when clicked). I ...

Tips for designing HTML tables: Highlight cells by filling them with color, enlarge images when hovering over them, and add color to

I'm currently working with nested HTML tables and facing some challenges with styling. Below is the table I am dealing with: Note: The blue area represents when hovering over. The specific styling modifications I want to make are: 1. Have the im ...

What to do when the image-sprite is too large for the container and needs to be resized to fit within a smaller

Is there a way to resize the sprite image to fit the container without using the tag? The sprite image dimensions are 562px (x5) width x 562px height main-desktop.png .container_outer{ height:200px; width:100%; } .chrome-part, .ie-part, .firefox- ...

Utilize a single submit button to navigate through multiple pages dynamically using JavaScript

I would like to navigate to different rooms with just one button using JavaScript. For instance, there are three rooms: "Kitchen, Toilet, and Bedroom". How can I utilize JS to enter any of these rooms based on my selection? If I input "kitchen" in the text ...

What could be causing the 'margin-top' property not to function as expected?

Although I understand the concept of 'margin-collapse', I am puzzled as to why there is no visible 10 px margin on the top of the first box here. The top box, which has the id 'first', should have a 10px margin above it. If this method ...

Show a pair of pictures every X hours using Javascript

Trying to create a code that displays different pairs of images each day, but struggling to make it select them randomly. Instead, the code currently just goes through the array one by one. I'm not great with Javascript and haven't found a way to ...

Modify text within the span element that corresponds to the parent's href attribute

I need to modify the text within a span element, but I'm having trouble targeting it by class or ID since they share the same classes. The only difference I can see is the href attribute of the parent link. Is there a way for me to target this specifi ...