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 8612523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:38:53+00:00 2026-06-12T04:38:53+00:00

from a PHP file that I don’t have access to, I receive a bunch

  • 0

from a PHP file that I don’t have access to, I receive a bunch of <li> elements with a class of “liElHtml”. Contained in these are images, so essentially I receive this via AJAX:

<li class="liElHtml"><img src="some_img.png" /></li> 

is there anyway to stack these neatly/evenly in 3 rows without having a static width? The only way I’ve known how to do this by setting the combined width of the 3 <li>‘s to the <ul>. I’ve googled around and it seems a static width is the only way I see.

Unfortunately this has to be 3 rows at 100% width to fill the screen because it’s for phones.
Right now just to get it to work I set a static width so I have for the html:

<ul id="mainScreenUL">
</ul>

The CSS:

#mainScreenUL{
    list-style:none;
    width:150px;
}

#liElHtml{
   display:inline-block;
   width:50px;
   height:50px;
}

And the jQuery/javascript

$('#mainScreenUL').html(pic_data[1]);

The pic_data[1] is just one long string of <li class="liElHtml"><img src="some_img.png" /></li>

This gives me a somewhat desired effect, is there anyway I can set the width to width:100% on #mainScreenUL and get the <li>‘s to stack neatly into only 3 rows?
Thank you for taking the time to read this, any help is greatly appreciated.

  • 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-12T04:38:54+00:00Added an answer on June 12, 2026 at 4:38 am

    if all li have the same height you could easily float them and assign a 33.33% width in this way

    li {
       float: left;
       width: 33.33%;
    }
    

    then just remember to apply a float clearing to ul element

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

Sidebar

Related Questions

First I have a PHP file that gets data and file from a HTML
I have a PHP file that serves up a JSON array populated from a
I have a PHP file that is needed to be run from the command
I have a functions.php file that has one PDO Connection i use to access
I need a simple proxy PHP function/script that can download a file from a
So I have a PHP file that I use to define all my constants
I want to generate PDF from a PHP file that includes HTML controls like
I have a php file that contains a HTML form, then PHP logic, then
I want to sent some information through a from, executing a php file that
I have settings.php file that I want to keep some constants in, like my

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.