Automatically change the height of the UI element in HTML

I'm currently working on building a table view using the ul tag in HTML. Within the link provided, I've utilized two li tags to create a two-column layout. To visually represent the spaces occupied by the li tags, column dots, and row dots, I've included two images. The necessary HTML, CSS, and image files are all provided for reference.

Attached Images

index.html -> http://pastebin.com/d8nq8pfr
style.css -> http://pastebin.com/V7iR3ZqE

Upon examining the layout generated by the files, you might notice that the second row of the table display has uneven heights. This is due to the heights coming from different ul tags.

My question is, is there a method to ensure that both heights are the same (using the highest height as the basis for consistency, of course)?

Answer ā„–1

Should you find yourself working with tabular data, it is recommended to organize it within a table structure for best presentation. However, if tables are not an option, you can mimic their behavior using CSS with some limitations (such as no rowspans or colspans):

#title1, #title2 {
    display: table-cell;
}

Please note that this method may not be supported in Internet Explorer 7 or older browsers.

Answer ā„–2

It's important to carefully consider whether the data being presented is best suited for a table format. Tables are not inherently bad, but they should be reserved for actual tabular data. The definition of a "table" can be quite broad, and even using tables to structure forms isn't necessarily incorrect, although it may be a bit of a gray area.

If after consideration, it is determined that the content is semantically an unordered list, the CSS table model can be utilized to display elements in a tabular format. This can be achieved by applying styles like display: table, display: table-row, and display: table-cell to the appropriate elements. Keep in mind that these styles may not be supported in older browsers like IE7 and earlier.

If there is a need to support older browsers like IE7 or even IE6, column layout patterns may need to be employed. There are numerous resources available online dedicated to discussing various column layout patterns.

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

Challenges with looping in Jquery animations

I've been working on an animation function that I want to run in a loop. So far, I've managed to get it to work for one iteration, but I'm struggling to figure out how to repeat the loop a specific number of times. Below is the code for my a ...

Customizing the CSS shadow for a specific ionic select text color, while ensuring that other ion select instances remain unaffected

I'm encountering an issue while attempting to customize the text color inside an ion select element based on the option selected. Unfortunately, when I make changes to the shadow part in one component, it affects other components as well. I want to ap ...

Unwanted extra border and padding are showing up at the bottom of my HTML

Recently, I decided to experiment with the jquery superslide plugin on a website of mine. To my surprise, there was an unexpected padding at the bottom of the page. My suspicion is that the display area is not being calculated correctly or that a margin is ...

If element Div is labeled as either A, B, or C, it should smoothly fade out and then fade in as Div

I'm currently working on enhancing the navigation of my portfolio website and Iā€™m facing a challenge in adding additional properties to my toggle() function. This basically involves creating a filter system with four possible options, which are: ...

Retrieve the current width and height of an image after the maximum width and height constraints have been applied

Check out this example The HTML: <div class="container"> <img src="http://placehold.it/500x500" alt="500x500" /> </div> <div class="container"> <img src="http://placehold.it/100x500" alt="100x500" /> </div> < ...

conceal a component within a different container

Is there a way to hide or show an element within a container based on the hover state of another container? Here is an example of what I have tried so far: HTML5 <div class="left-menu-container"> <div class="left-menu-inner-container"> ...

What is the best way to pass a CSS root constant to a separate CSS file?

In my Angular test project, I'm experimenting with using the same colors repeatedly. To achieve this, I created a constants.css file where I defined all my root constants, which currently consist of colors. However, I've hit a roadblock when atte ...

Circular graphs displaying percentages at their center, illustrating the distribution of checked checkboxes across various categories

Looking for a JavaScript script that displays results in the form of circles with percentage values at their centers, based on the number of checkboxes checked in different categories. The circle radius should be determined by the percentage values - for e ...

Element mysteriously concealed in certain Safari cases, consistently visible in Firefox and Chrome

A new angular application has been developed as a "bounce" page for an upcoming social iOS app currently in public beta. Users have the ability to share their profiles by simply providing a link to the site. If the page is accessed via an iOS device w ...

Looking to modify the height and width of an image when it is hovered over using inline CSS

My current project involves working with a dynamic template where the HTML code is generated from the back-end using TypeScript. I am trying to implement inline CSS on hover, but despite having written the necessary code, it does not seem to work as intend ...

What is the best way to position a div as a footer within a larger main div?

I am aiming to create a div with simple header, content, and footer sections. Here is the design I am trying to achieve: https://i.stack.imgur.com/QfnGa.png You can check out my code on jsfiddle. I'm having trouble understanding how the relative lay ...

Utilizing Google Maps within a responsive layout with 2 columns

Seeking guidance on integrating a map into the second column of a responsive website. Acknowledging that my code may not be optimal, as this is my first attempt at such a task. After a day of searching for solutions, I'm feeling quite desperate. HTML ...

Resizable icon next to inline element caused width adjustment

I have a group of individuals listed, each with two elements side by side: a "contact me" button (an 'a' element with a fontawesome icon) and a tag displaying the user type (span element). Some users do not have a tag, and when there is one prese ...

focusing on a specific category within a CSS identifier

My goal is to specifically target the class .page-has-children within this code snippet: <div id="dc_jqverticalmegamenu_widget-2" class="widget sidebarwidget "> <div class="dcjq-vertical-mega-menu" id="dc_jqverticalmegamenu_widget-2-item"> ...

What is the best way to eliminate the gap above a block element using CSS?

Currently in the process of designing a website, I am faced with a challenging issue that seems to have me stumped. The structure of my page consists entirely of HTML DIVs, with certain elements nested within their parent DIVs. My main dilemma lies in tryi ...

The image will come to life with animation as the background position is adjusted using Skrollr

Trying to create a div that switches the background image every X pixels scrolled. Initially experimented with changing the background-image, including using sprites and adjusting background position, but encountered a distracting "flickering" effect. Exa ...

Cross Browser Compatibility for CSS Page Scrolling to the Right and Handling White Space/Margins

Currently in the process of developing a WordPress Theme at . Struggling with achieving equal left and right margins around the center container, resulting in the page displaying white space and allowing unnecessary scrolling. Seeking advice from anyone wh ...

How to make a div stretch to full browser height using CSS and jQuery

I've been attempting to stretch a div to the browser's height using CSS in jQuery, but it doesn't seem to be working. I can successfully apply 100% width to the div, but height is proving to be a challenge. Any ideas why this might be happen ...

Steps to easily modify the color of Font Awesome stacked icons when hovering over them

I have incorporated two Font Awesome icons into my design: fa-circle-thin fa-user-plus These icons are stacked to create a circular icon appearance. <span class="fa-stack fa-sm"> <i class="fa fa-circle-thin fa-stack-2x"></i> <i c ...

Navigating pinch to zoom: Strategies for managing varying page locations

I've been using a combination of JS and CSS to position images within the viewport in a way that allows them to scale and translate accurately to fill the space. For the most part, this method works smoothly and is also able to handle browser zoom fu ...