Troubleshooting problem with Bootstrap column and grid dimensions

I have a Bootstrap page displaying a title along with 2 forms in a single row positioned above a table. The 2nd form, located at the top left above the table, is currently occupying the full width of the parent column (col-md-8) when it only needs to occupy about half of the column's width.

I am struggling to figure out how to adjust the positioning of this form so that it takes up less space while still aligning with the left side of the title and table. To see how it currently appears, use the full page option as it is designed for desktop viewing only.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />

<div class="container">

<div class="row">
  <div class="col-md-8">
    <h1>Items List</h1>

    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>

    <form class="form-horizontal" id="findItems" action="#" method="get" role="form">
      <input type="hidden" name="action" value="findItems">
      <table class="table table-bordered">
        <tr>
          <td><input type="text" class="form-control" name="itemID" id="itemID" placeholder="Shipment ID"></td>
          <td><input type="text" class="form-control datepicker" name="shippingDate" id="shippingDate" data-date-format="dd/mm/yyyy" placeholder="Date Shipped"></td>
          <td class="text-center">
            <button type="submit" class="btn btn-success">Update All</button>
          </td>
        </tr>
      </table>

    </form>



  </div>
  <!-- /.col-md-8-->


  <div class="col-md-4">

    <div>
      <form class="form-horizontal" id="findMoreItems" action="#" method="get" role="form">
        <input type="hidden" name="action" value="findMoreItems">
        <table class="table table-bordered">
          <tr>
            <td>Shipment ID:</td>
            <td><input type="text" class="form-control" name="shipmentID" id="shipmentID" placeholder="Shipment ID"></td>
          </tr>
          <tr>
            <td>Authority ID:</td>
            <td><input type="text" class="form-control" name="authorityID" id="authorityID" placeholder="Authority ID"></td>
          </tr>
          <tr>
            <td>Ref ID:</td>
            <td><input type="text" class="form-control" name="refID" id="refID" placeholder="Ref ID"></td>
          </tr>
          <tr>
            <td>Serial Number:</td>
            <td><input type="text" class="form-control" name="serialNumber" id="serialNumber" placeholder="Serial #"></td>
          </tr>
          <tr>
            <td colspan="2" class="text-center">
              <button type="reset" class="btn btn-default">Reset</button>
              <button type="submit" class="btn btn-success">Search</button>
            </td>
          </tr>
        </table>

      </form>
    </div>

  </div>
  <!-- /.col-md-4-->

</div>
<!-- /.row-->


<br>


<div>

  <br />
  <table class="table table-condensed table-striped table-bordered">
    <thead>
      <th class="text-center" scope="col">Shipment ID</th>
      <th class="text-center" scope="col">Item ID</th>
      <th class="text-center" scope="col">Serial Number</th>
      <th class="text-center" scope="col">Shipped Date</th>
    </thead>
    <tbody>
</tbody>
  </table>

</div> 

</div><!-- /.container -->

Answer №1

To create some extra spacing, consider inserting a spacer column. Here's an example:

<div class="col-md-6"> content for table one </div>
<div class="col-md-2"> spacer column </div>
<div class="col-md-4"> content for table two </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

Progress bar arrows undergoing transformation in shape

I am currently developing an angular application where I have implemented a progress bar. The CSS code I have used is: CSS: .progressbar { height: 56px; background: lightgray; box-shadow: inset 0px -2px 5px rgba(0, 0, 0, 0.5); anim ...

How can I upload a folder with subfolders and keep the structure intact?

I'm working on a form that allows me to upload a folder containing both files and subfolders with more files inside. I managed to upload the folder successfully, but when I check my directory, all the files are in one folder without the subfolders. My ...

Move the components over to the right

How can I vertically align the user and the search bar on the right side of the page? #search { float: right; margin-top: 9px; width: 250px; } .search { width: 230px; height: 30px; position: relative; line-height: 22px; } ...

an issue encountered while trying to print a webpage styled with CSS

Users are given the option to print the current page on the website by clicking on a menu element: <li> <a href="#" onClick="window.print()"> <i class="icon-print"></i> Print Page </a> </li> The page contai ...

Changing the name of a radio button dynamically using jQuery

Trying to find a solution like the following: $("input:radio:checked").previous("name", "original_name").attr("name","new_name"); I've experimented with a few methods found here, but keep encountering the error: Object Expected Any assistance would ...

Safari alters the header color on mobile devices

Debugging this issue has been quite challenging - the number at the top of the page appears in white before changing to a dark grey on iPad and iPhones running Safari. Why is this happening?! It functions correctly on all other devices! Check out www.col ...

Unable to write to csv file in UTF-8 using PHP fwrite, experiencing issues

Looking for assistance with handling PHP fwrite as CSV file is displaying incorrect characters. The output appears like this: općšpšćšćšp ćpšćpšćp šćpšćpšć This is the PHP code being used fo ...

"Using jQuery to dynamically change the src attribute of an iframe, the change persists even after

There's a strange issue bothering me. On a single page, I have a menu and an iframe. Whenever I click on a menu button, the jQuery code changes the src attribute of the iframe. Initially, when the page loads, the iframe is supposed to display "Home". ...

ShadowBox replacement for IE8

After much experimentation, I am on the verge of achieving an inset box shadow for IE8 without relying on JavaScript. Take a look at the screenshot below: https://i.sstatic.net/2kM3R.png Since Internet Explorer versions 5.5 through 8 only support Micros ...

Executing a C++ application within a web browser

I'm looking to integrate my C++ program that generates random sentences from a word bank into my personal, low-traffic website. Ideally, visitors could click a button and see a new sentence displayed on the page. What would be the easiest way to accom ...

CSS styles may not be consistently displayed or may vanish after being initially implemented

The colors and background remain unchanged. In previous projects, everything ended up falling apart Refreshing the page with F5 or CTRL + F5 does not make a difference. When using Open Live Server in VS Code, it initially shows the changes being applied b ...

Looking to enhance my JavaScript skills - Codepen samples welcome!

I have incorporated this code pen in my website to create a menu button for mobile view: http://codepen.io/anon/pen/LNNaYp Unfortunately, the button sometimes breaks when clicked repeatedly, causing the 'X' state to appear even when the menu is ...

Explore/Discover feature on a website

I'm currently working on a webpage where I am querying a database and retrieving file paths. I have successfully displayed the path from the database on my page. Now, as an enhancement, I would like to add an 'Open' button next to the displa ...

Issues with JQuery onclick function on dropdown menu functionality not behaving as desired

Take a look at some example code here. Here's the HTML: <div> HTML<br> <li> <select id="Status" type="text"> <option value="New">New</option> <option value="Complete">Complete</option& ...

Add a CSS class to a dropdown menu option in HTML and JavaScript (JQuery) if it has a specified ID

I am brand new to HTML and JQuery, and I'm struggling with setting a class for my select element when the currently selected option has an ID of "answer". This is crucial for checking the correctness of a multiple choice question. If achieving this i ...

Disabling the ESC key from clearing input fields in Bootstrap-5: A step-by-step guide

I have come across this code snippet for a search field: <form class="container" role="search"> <div class="row"> <div class="col-12"> <input name="searchItem" #search ...

Unique rephrased text: "Varied wrapping styles in both

Feeling frustrated with a seemingly commonplace issue. Despite the thousands of times it has been asked before, I can't seem to find an answer on Google. I wanted to neatly display my text within one of my cards, but so far I've only achieved th ...

Removing cookies after sending a beacon during the window unload event in Chrome

Here's the situation: I need to make sure that when the browser is closed or the tab is closed, the following steps are taken: Send a reliable post request to my server every time. After sending the request, delete the cookies using my synchronous fu ...

What is the proper way to incorporate html entities in my specific situation?

In my application, I am attempting to incorporate double macron characters. My current method involves using the &#862; entity, like this: t&#862;t, which results in t͞t. However, I have encountered issues with reliability, as sometimes the ...

What type of Javascript is required for a photo carousel that displays random images from a designated folder?

I have a minor issue that has been keeping me up at night. I can't seem to shake it off and find the right solution! Currently, I am working with Bootstrap 4 as my Framework. My task is to create a full-page Carousel that cycles through images random ...