Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:04:59+00:00 2026-06-15T03:04:59+00:00

Intro Hi there, I have a table made with lists <ul> that looks like

  • 0

Intro

Hi there,

I have a table made with lists <ul> that looks like this.

As you can see, I have added getMaxLiWidth() to achieve the biggest <li> width for all.

Before

#|Name|Extra

1|This is a very big name|Extra

What I want

#|Name                                      |Extra

1|This is a very big name|Extra

What I get

#                                      |Name                                      |Extra

Question

How do I need to change my getMaxLiWIdth() to get the max width for each “column”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:05:02+00:00Added an answer on June 15, 2026 at 3:05 am

    You need to set the css for all the list items in the widest column. First you have to identify the widest column, then return it with the max width, then use it as part of the selector.

    function getMaxLiWidth() {
        var maxWidth = 0;
        var column = 0;
        $('li').each(function() {
            if (this.offsetWidth > maxWidth) {
                maxWidth = this.offsetWidth;
                column = $(this).index();
                console.log(column);
            }
        });
        return [maxWidth,column];
    }
    
    $(function() {
    
        var arr = getMaxLiWidth();
        $('li:nth-child(' + (arr[1] + 1) + ')').each(function() {
            $(this).css({
                'width': arr[0]
            });
        });
    });
    

    Here is a demonstration: http://jsfiddle.net/Dcd7R/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SQLite I have a table that is created like this (simplified): CREATE TABLE
I'm using php,html,javascript,mysql. My functionality goes like this. I have a division made in
I'm trying to make an address book. And have made my tables like this:
I have a table customer that stores a customer_id, email and reference. There is
Is there any way I can have a thread branch off into its own
Intro I work in a facility where we have microscopes. These guys can be
Is there any way I can combine list of expressions into one? I have
I have a page that loads an external HTML page into an iFrame. There
Why can't I browse deeper into the folder, I still have some folders there:
I have a table containing roles. Many users can be assigned to a role.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.