The CSS styling in Internet Explorer 11 is causing cells to merge into the same column in a table

In my CSS-styled form that resembles a table, the two input elements are displaying on top of each other instead of side by side. How can I adjust them to appear next to each other?

There is a possibility that this issue could be browser-specific. The form is currently being viewed on IE 11.0.14393.0 running on Windows 10.

div,
a {
    font-family: Segoe, "Segoe UI", sans-serif
}

.FormContainer form {
display: table;
}
.FormContainer form div {
display: table-row;
}
.FormContainer form div label,
.FormContainer form div input {
display: table-cell;
margin: 5px 0px;
}
.FormContainer form div label {
vertical-align: middle;
padding-right: 10px;
}
.FormContainer form div input[type=text] {
min-width: 200px;
}
<body>
    <div>
      <p><font size="6"><u><strong>Search Users</strong></u></font></p>
  <p>Search for...</p>
    </div>
    <div class="FormContainer">
      <form action="SearchNewestUsers.php" method="post">
        <div>
          <label for="UserCount">Newest users</label>
          <input type="text" name="UserCount" id="UserCount" placeholder="Enter number of users...">
          <input type="submit" name="SearchButton" id="SearchButton" value="Search">
        </div>
      </form>
    </div>
</body>

The code snippet provided results in the following layout:

https://i.stack.imgur.com/T8ES7.png

Answer №1

It appears that the issue lies with Internet Explorer not supporting the display: table-cell property as intended. A workaround I have discovered is to switch to using inline-block for both input elements.

div,
a {
  font-family: Segoe, "Segoe UI", sans-serif
}
.FormContainer form {
  display: table;
}
.FormContainer form div {
  display: table-row;
}
.FormContainer form div label,
.FormContainer form div input {
  display: table-cell;
  margin: 5px 0px;
}

.FormContainer form div input {
  display: inline-block!important;
  margin: 5px 0px;
}
.FormContainer form div label {
  vertical-align: middle;
  padding-right: 10px;
}
.FormContainer form div input[type=text] {
  min-width: 200px;
}
<body>
  <div>
    <p><font size="6"><u><strong>Search Users</strong></u></font>
    </p>
    <p>Search for...</p>
  </div>
  <div class="FormContainer">
    <form action="SearchNewestUsers.php" method="post">
      <div>
        <label for="UserCount">Newest users</label>
        <input type="text" name="UserCount" id="UserCount" placeholder="Enter number of users...">
        <input type="submit" name="SearchButton" id="SearchButton" value="Search">
      </div>
    </form>
  </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

Guide on centering an unfamiliar element in the viewport using HTML, CSS, and JavaScript

In the process of developing my VueJS project, I have successfully implemented a series of cards on the page. However, I am now facing a challenge - when a user selects one of these cards, I want it to move to the center of the screen while maintaining its ...

Developing User-Friendly Websites with Responsive Design

While I was working on my project, I realized that using only pixel values in tables and sidebars was a big mistake. This caused issues because if someone had a different screen resolution, my website would look distorted and unappealing. Could you please ...

Tips for adjusting image size to take up only half of the screen in NextJS

Struggling to resize an image to fit only 50% of the screen in NextJS? The Image component provided by NextJS comes with its own inline styling, making it tricky to customize. Currently, I attempt to style the image by wrapping the Image component in a spa ...

Schedule Master: A sophisticated tool for time management

I have been following the instructions to implement a date time picker from this tutorial. I downloaded the necessary js and css files and placed them in the respective directories. However, when I click on the calendar icon, the calendar does not pop up. ...

Setting the child elements of a CSS div to have the same width and be larger than the

Welcome everyone to my inaugural post! I hope I've followed the right steps. I'm encountering an issue where I have child divs that need to have equal widths. The #content can sometimes exceed the browser window's width (hence the 3000px), ...

Arranging Text and Images in HTML/CSS to Ensure Optimal Placement When the Window Size Changes

Hello fellow coders! I've recently started diving into the world of website development and I have a query regarding positioning elements and handling window resizing. Can anyone help me out? I'm trying to center an image, a message, and a passw ...

What steps do I take to eliminate this additional content?

Currently working on a web messenger project and facing an issue with a specific bar that I want to remove from my interface: Within the Home.blade.php file, the code snippet looks like this: @extends('layouts.texter') @section('content&ap ...

What is the best way to change the value of a div using JavaScript?

i could really use some assistance, i am trying to ensure that only the selected template is shown on the screen, while all others are hidden. The expected outcome should be to replace the values of: <div class="city">City<span>,< ...

Crafting a captivating stacked image using just two segments

Recently, I designed my own personal website. To make it visually appealing, I decided to use a background picture as the header and placed my portrait as the avatar. My inspiration for the design was drawn from the sleek interface of Linkedin profiles. Ho ...

Restoring list item to standard CSS styling

I am having trouble with the alignment of my links. They are currently displayed in a horizontal manner instead of vertically like this: First link Second link Third link The current layout shows the links next to each other as follows: Firs ...

iOS devices will not scroll horizontally if there is a div that scrolls vertically within a div that scrolls horizontally

Picture a div that scrolls horizontally, housing two vertical-scrolling divs. You'll need to scroll left and right to navigate, then up and down inside the inner divs to read the content. /* RESET TO MINIMUM */ body, html { height: 100%; mar ...

Which component from the Bootstrap library would be best suited for my needs?

I am looking to create a basic 6-page website. Here is the code for my main page: <html> <style> .ali{ width:170px; text-align:center; } footer{ background:#333; color:#eee; font-size:11px; padding-top: 25px; p ...

What is the best way to iterate through two separate "div" elements that contain different data in each?

Currently, I am working on implementing a timeline feature in my web application. I have two distinct divs, each containing different data. Despite utilizing a foreach loop, I am encountering unexpected issues with its functionality. Could someone please a ...

Unique WordPress Loop Design (Grid/Row)

Looking for a custom Wordpress post loop that will display posts in a specific format. The desired layout includes two posts in each "col" div, both contained within a "row" div: <div class="row cols2"> <div class="col left"> <a href="#"> ...

What is the best way to ensure jQuery runs as soon as the page loads?

In my current jQuery script, I have implemented a feature that checks for content in two input fields (a login page with username and password) and adds the class "used" if there is content present. $(window, document, undefined).ready(function() { $(&a ...

Is there a CSS4 resolution for transitioning from 0 to auto?

I searched extensively for information on CSS4, but unfortunately I came up empty-handed. Back in the era of CSS3, a common challenge arose when it came to height transitions from 0 to auto without relying on JavaScript. The introduction of transitions sa ...

Showing Text Information from a distant web server's jQuery.getJSON() script

I am currently working on a personal project that involves displaying data from a remote server. The HTML code I am using looks like this: <script> jQuery.getJSON("http://someurl.com/something.cgi? AJZ=1&STOCK=S", function(data) { if (data.inform ...

Improving Vue Component on Navigation

I am facing an issue with my navbar where I have two versions. Version 1 features a white text color, while Version 2 has black text. The need for two versions arises due to some pages having a white background, hence the requirement for black text. Bot ...

Access the content of each cell in a table using JavaScript

I need help with a scenario involving a table that has 4 rows, where the 4th row contains a textbox. When the "onchange" event of the textbox is activated, I want to retrieve the data from the cells in that specific row and transfer it to another table. It ...

Performing date comparison in JavaScript with varying date formats

My system includes a table that retrieves dates from an FTP location. On the user interface page, there is a form that gathers all details related to a specific FTP date. However, I am facing difficulties in comparing the FTP dates with those specified in ...