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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:27:54+00:00 2026-05-31T12:27:54+00:00

I have HTML content that generates a dynamic number of span elements with accompanying

  • 0

I have HTML content that generates a dynamic number of span elements with accompanying UL’s.
Due to how the spans & UL’s are generated they are written in a set order.

What I am looking to achieve is for each span to go across the top and then have the accompanying UL underneath it.

Here is the segment of HTML:

<div id="suggested" >                  
  [% FOR row IN suggestions  %]
  [% "<span>" row.0 "</span><div class="clear"></div><ul>" "" IF loop.first %]
  [% FOR u in row %]
  [% IF loop.index > 0  %]
    <li><a name="sugg" href='[% script_name %]/register?key=[% u %]' value="[% u %]">[% u %]</a>
      [% END %]
        [% "</ul>" IF loop.last %]                             
         [% END %]
          [% END %]
           </div>

and the CSS:

    #suggested 
{
  width:100%;
  height: 400px;
  display: block;

}

.clear {
 clear:both;   
}

#suggested ul
{
    display:inline-block;
    width: 20%;  
    list-style: none; 
    float:left;
    margin: 0 4px;
  padding: 0;
  text-align:left;
  overflow: hidden;

}
#suggested span {

    width: 20%;
    border-bottom: 1px #000 dotted;
    display:inline-block;

}
#suggested ul li:nth-child(2n+1) {
    background: #eee;
}

#suggested ul li 
{   

    width: 100%; 
    margin: 5px 0;
  padding: 2px;
  text-align:left;
  text-overflow: ellipsis;
  display: table;
  word-wrap: normal;
}

The output isn’t what I desire but instead the span elements float left to the UL but I want them to float left to the previous span element and have the UL associated with the span float left to the previous UL.

Thus forming something like:

<span><span><span><span><span>
 <ul>  <ul>  <ul>  <ul>  <ul> 

But as I’ve said, each span and UL pair are created in sequence.

Any ideas how I can achieve what I desire?

  • 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-05-31T12:27:56+00:00Added an answer on May 31, 2026 at 12:27 pm

    Is this the effect you are going for?

    http://jsfiddle.net/meEMp/

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

Sidebar

Related Questions

I have one site that is displaying html content that needs to be displayed
I want to parse a html content that have something like this: <div id=sometext>Lorem<br>
I have a php file as given below. The page generates html content which
I have a number of div s in my HTML file that are dynamically
I have this code: = link_to unsubscribe instantly, *|UNSUB|*.html_safe That generates this HTML: <a
I have a dynamic website with html editors for creating article content, however for
I have HTML Content which was being displayed in a UITextView . The next
If I have HTML content in a variable like so: var data = <div
Suppose we have this html content, and we are willing to get Content1, Content2,..
I have seen some mails which has HTML content embedded in them. The content

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.