I encountered a height discrepancy when attempting to style an unordered list to resemble a table

I have created a set of ul lists that appear as a 2-column table, just as I needed. However, an issue arises when the content of any list increases. The problem is that equal height is not being applied, causing the table to look broken.

Here is my Fiddle and below is the snippet

    ul.filter_list {
      margin: 0px;
      padding: 0px;
      width: 100%;
      display: table;
      border: 1px #000 solid;
    }
    li.filter_cell {
      display: table-cell;
      width: 50%;
      float: left;
      padding: 4px;
      border-collapse: collapse;
      border-top: 1px #000 solid;
      box-sizing: border-box;
    }
    ul.filter_list li:nth-child(odd) {
      border-right: 1px #000 solid;
    }
    .filtertab_title {
      font-family: 'open_sansbold';
      margin-top: 8px;
      margin-bottom: 5px;
      margin-left: 16px
    }
    .filtertab_value {
      margin-bottom: 10px;
      margin-left: 16px
    }
<ul class="filter_list">
  <li class="filter_cell">
    <div class="filtertab_title">PMT Base Name</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </li>
  <li class="filter_cell">
    <div class="filtertab_title">Category</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </li>
  <li class="filter_cell">
    <div class="filtertab_title">Pattern Category Name and documentation information for lorem text goes here dummy text</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </li>
  <li class="filter_cell">
    <div class="filtertab_title">GMT Base Name</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </li>
  <li class="filter_cell">
    <div class="filtertab_title">Measurement</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </li>
  <li class="filter_cell">
    <div class="filtertab_title">Base Name</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </li>

</ul>

Answer №1

modify the layout

<div class="filter_divst">
<div class="filter-row"> <!--introducing this element to construct a row for 2 columns-->
    <div class="filter_cell">
      <div class="filtertab_title">PMT Base Name</div>
      <div class="filtertab_value">
        <select class="filtertab_select">
          <option>Any</option>
        </select>
      </div>
    </div>
    <div class="filter_cell">
      <div class="filtertab_title">Category</div>
      <div class="filtertab_value">
        <select class="filtertab_select">
          <option>Any</option>
        </select>
      </div>
    </div>
  </div>
<div class="filter-row"> <!--implementing this element to establish a row for 2 columns-->
    <div class="filter_cell">
      <div class="filtertab_title">Pattern Category Name and documentation information for lorem text goes here dummy text</div>
      <div class="filtertab_value">
        <select class="filtertab_select">
          <option>Any</option>
        </select>
      </div>
    </div>
    <div class="filter_cell">
      <div class="filtertab_title">GMT Base Name</div>
      <div class="filtertab_value">
        <select class="filtertab_select">
          <option>Any</option>
        </select>
      </div>
    </div>
</div>
<div class="filter-row"> <!--utilizing this element to create a row for 2 columns-->
    <div class="filter_cell">
      <div class="filtertab_title">Measurement</div>
      <div class="filtertab_value">
        <select class="filtertab_select">
          <option>Any</option>
        </select>
      </div>
    </div>
  <div class="filter_cell">
    <div class="filtertab_title">Base Name</div>
    <div class="filtertab_value">
      <select class="filtertab_select">
        <option>Any</option>
      </select>
    </div>
  </div>
</div>
</div>



div.filter_list
{
    margin:0px; 
  padding:0px; 
  width:100%;
  border:1px #000 solid;/*including this */
}
.filter-row{ /*adding this */
  width:100%;
  display:flex;
  -webkit-display:flex;
}
div.filter_cell
{
  width:50%; 
  padding:4px; 
  box-sizing:border-box;/*including this */
  border-collapse:collapse; 
  border-top:1px #000 solid;
  box-sizing:border-box;
  border-left: 1px #000 solid;
}

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

Issue with Semantic-UI Special PopUp not displaying on screen

I'm currently working on creating a unique pop-up feature using custom HTML, with the intention of adding content to it later on. My console is displaying the following message: Popup: No visible position could be found for the popup. $(document) ...

A one-page digital space that functions as a dynamic slide show

Check out this cool website I want to emulate. The site is a single-page design where you can navigate vertically using various methods like keyboard, mouse, scroll, or swipe gestures. There are carousels that allow left and right navigation. Each section ...

What is the process by which photoswipe applies styles to blur an image upon clicking the share button?

If you want to see an example, check out this link: http://codepen.io/dimsemenov/pen/gbadPv By clicking on the Share button, you'll notice that it blurs the image (and everything else). Despite inspecting it closely, I still can't seem to figu ...

Tips on transforming JSON output into an array with JavaScript

Looking for a solution to convert a Json response into an array using JavaScript. I currently have the following json response: ["simmakkal madurai","goripalayam madurai"]. I need to transform these results into an array format. Any suggestions on how I ...

Seeking a precise placement, must find a CSS-only answer

After spending two days experimenting with different CSS styles like absolute positioning, inline/inline-block display, and flex display, I have yet to find a solution for styling a timestamp's label position using pure CSS. https://i.stack.imgur.com ...

Rails : CSS/JavaScript functioning perfectly on local server, facing issues on Heroku deployment

My Rails website features various CSS animation effects and JavaScript elements. While these transitions function smoothly on my local environment, they do not work properly on Heroku. Examining the Heroku logs: 2013-09-17T17:13:36.081145+00:00 app[web.1 ...

Removing an unnamed cookie

A mysterious cookie mysteriously appeared on my website, courtesy of Sharethis (value "sharethis_cookie_test"). This cookie is causing all sorts of session issues for me specifically on Chrome. Despite removing the sharethis plugin from my site, this pesky ...

Want to know how to get images to show up when sharing a link on Twitter?

For illustration purposes, I am using a CNN article page: The HTML head section of the webpage contains the following tag: <meta name="twitter:image" content="http://i2.cdn.turner.com/money/dam/assets/150114084151-inside-tracker-120x90.png"> Howe ...

What methods can I utilize to transmit Global variable data from a view to a controller?

In my Angular view file, I have the following code snippet. <!DOCTYPE html> <video id="myVideo" class="video-js vjs-default-skin"></video> <script> var dataUri; var videoData; var player = videojs("myVideo", { controls ...

Tips for maintaining a single-line div while adding ellipses:

What is the CSS way to ensure that a div or class contains only one line of text, with ellipses added if it exceeds that limit? I am aware that setting a specific height and using overflow:hidden can achieve this, but it doesn't quite work for my need ...

The application encountered an exception and has ceased to respond, displaying a custom error page

I have a .NET application running on IIS 7 that is accessed from IE7. When a specific exception occurs, the page is redirected to a plain .htm page with a back button that should take the user back to the previous page. This exception handling is implement ...

What is the method to obtain the coordinates based on a city name, and subsequently store those coordinates in a variable?

I'm currently exploring ways to extract the geographical coordinates based on user-provided city names. I am aware that Google offers this functionality through their API, but I am struggling with how to actually capture and store these results in PHP ...

What is the best way to make this CSS arrow see-through?

My goal is to achieve this desired outcome: https://i.sstatic.net/4eTpE.png Currently, I have the following (focusing only on the left element for now): https://i.sstatic.net/nUFp1.png I am struggling to make the left arrow transparent and I can't ...

How come the nth-child selector remains unaffected by other selectors?

Here is an example that I have created for this issue: http://jsfiddle.net/SXEty/ <style> table td, th { padding: 8px; text-align: left; } table td:nth-child(1) { color: red; } table td { color: blue } </style> ... <table> <tr> ...

Accumulation of style from various directives in AngularJS on a single element

Currently, I am working on developing a component framework and find myself in need of a method to apply styles from multiple directives to an element in a way that they can accumulate. The priority of the styles should be determined by the directive creat ...

Setting up the file structure for customizing Bootstrap with Sass

Hello, I am currently setting up Bootstrap for customization using Sass. After creating an HTML page, I attempted to add my own custom properties to the custom.scss file. Unfortunately, these changes do not seem to affect my page as expected. I followed s ...

Customize the default classes for DataGrid in Material UI

Attempting to customize the CSS properties in the "DataGrid" Material UI, specifically adjusting font weight and overflow of the header. Below is the JSX code snippet: import React, {useState, useEffect} from 'react'; import {DataGrid, GridToolb ...

The alignment of the image background is malfunctioning on the iPad 3 device

Hey there, I need some assistance resolving an issue with a header background image on iPad3. The problem is that the image is not displaying correctly on iPad3 browsers, even though it works fine on desktop browsers. Below you can find my CSS and HTML cod ...

Link HTMLMediaElement with Android's playback controls

For my HTML/Javascript audio player that supports playlists, I have implemented a feature where the ended event automatically plays the next media in line. Everything works smoothly when using the player on Android Bromite browser, including the playback c ...

Select the M3 element in a ul using CSS targeting

I am working with a ul containing some li elements, here is an example: <ul class="M199 WIDTHBOX1 5ColumnBox"> <li class="M2"> <a class="M2" href="about-1561.aspx" target="">About</a> <div class="WIDTHBOX2" s ...