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

Unusual Quirk in HTML

I'm having a simple issue that I need help with... Does anyone know how to make the image fill the empty space on the right side of the text? Take a look at this screenshot for reference: Here is the HTML file: And here is the CSS file: dl.drop ...

The transparent sticky navigation bar isn't functioning as intended

I stumbled upon a code for the sticky navbar that I found on this website. Intrigued, I decided to copy the code and test it out on my Laravel blade file. The output turned out like this: Here is how I copied the code: CSS JS HTML Please provide me ...

Why isn't the field I added to my state functioning properly?

Can anyone explain why I am getting names without the added selected field??? I can fetch names from my API JSON (1) and I'm attempting to modify it by adding the selected field (2). export default function Display() { ... const init ...

Is it advisable to break down views into smaller components in Vuejs?

I'm currently managing a project with two folders for components - 1) src/components/ and 2) src/views. The general components like a drawer or nav are stored in the first folder, while the pages (views) are stored in the second. Now I face a challen ...

An unusual outcome occurred while attempting to duplicate the text

After copying the letter A, I noticed that an empty string is being logged to the console instead of the expected A. However, when I paste, the console does successfully log the letter A. document.addEventListener('copy', handler); document ...

Strategies for detecting when a child checkbox is clicked within a parent li element

Below is a snippet of Vue Code illustrating the structure we're working with: <template> <li class="mm-product-item" v-on:click="edit(item)"> <p class="mm-product-info input-field"> <input ...

What is the best way to erase information displayed when hovering over an element using mouseout?

Whenever the user hovers over an image, an information box appears regarding that specific image. The information inside the box changes as I move over another image, but when not hovering over any images, the information box remains visible. Unfortunately ...

Applying media queries to incorrect screen sizes

My media query seems to be behaving oddly. @media only screen and (max-width: 1200px) { .tool-panel { margin: 0px 24px 0px 0px; } } It is getting applied at 1183.20px instead of 1200px. This discrepancy is consistent across all browsers ev ...

jQuery: Revealing or concealing several divs upon selection alteration

When I populate a form, I want to display or hide multiple divs based on the OPTION selected in a DROPDOWN. Currently, my code works but the issue is that one div can be hidden or shown by multiple OPTIONS. As a result, these divs keep toggling between hi ...

The striped color override feature in Bootstrap appears to be malfunctioning in Internet Explorer 8

I have come across several discussions regarding this topic with various suggestions. My current objective is to make the alternating rows in Bootstrap (2.3.2) appear darker in Internet Explorer 8. To achieve this, I attempted to override the style by impl ...

Fill the center circle with GoJs background

Is there a specific way to paint the center circle only? I have provided an example project below. ...

How can you make the browser window scroll horizontally when a div is clicked using jQuery?

I have an image of an arrow inside a div. The div is positioned fixed in the bottom right corner of an extremely wide page. Is there a way to utilize jQuery to scroll the window 600px to the right each time the arrow is clicked? Also, can I detect when th ...

Fonts fail to load on Internet Explorer 10

Link to the website in question: In my fonts.css file, I am loading multiple fonts as shown below: @font-face { font-family: GothamBook; src: url('../fonts/Gotham-Book.otf'); src: url( ../fonts/Gotham-Book.otf ); /* IE */ } @font-face ...

determining CSS selector

Having trouble identifying a locator using CSS. There are 10 elements with the same locator name on the webpage. Each web element has the same XPath value: //div[@class='thumb_image'] The web element list size is 10. If I want to access the 5t ...

What is the best way to invoke an HTML file using a jQuery function in a JavaScript file?

When I call an HTML file from a jQuery function using require(), I am encountering an issue where I am unable to link the CSS with the HTML file. After running the file, only plain HTML is displayed without any styling. The structure of my HTML file is as ...

Unable to adjust dimensions with CSS width and height properties

I'm currently working on developing an online game with a login screen inspired by Paper.io. I have created the username input and play button, but there seems to be an issue with the width and height specified in the CSS file for the input field. Eve ...

Why must we always begin rotating with 0 in CSS Animation's webkit transform rotate?

Can anyone assist me with this issue? I have created a jsfiddle with an example. In summary, I am trying to rotate an "orange dart" in a circle every time the user clicks on a link. The rotation works fine, but the problem is that the "orange dart" always ...

I would like to take the first two letters of the first and last name from the text box and display them somewhere on the page

Can anyone help me with creating a code that will display the first two letters of a person's first name followed by their last name in a text box? For example, if someone enters "Salman Shaikh," it should appear somewhere on my page as "SASH." I woul ...

Creating responsive images in Bootstrap columns

I've found a solution to my issue with large images, but I am still struggling with smaller images not fitting well into larger spaces. Essentially, I created a CMS for a user who required templates with various bootstrap columns as content areas. Cu ...

Tips on serving a static file from a location other than the public or view directories following middleware in Express JS

I am organizing my files in a specific way. Inside the folder api-docs, I have an index.html file along with some CSS and JS files. My goal is to display the API documentation only for authenticated users. Since I am using Jade for views in this proje ...