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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:04:24+00:00 2026-06-17T15:04:24+00:00

I am working with my jsp and some jQuery and I would like to

  • 0

I am working with my jsp and some jQuery and I would like to create a list/ grid of buttons. The index of divs represents one of the items I am storing in session. Not the best idea, but it is the route I am choosing to take. I am planning to use the script below to figure out which div has been clicked. I took it from the jQuery site.

$("div").click(function () {
    var index = $("div").index(this);
    //ajax work here
});

I want this list to be in a grid 2 columns wide. If I used span to encapsulate every 2 divs, what would I have to change in order for it to work? It isn’t doing much for me now? Or is it better to use table tags?

  • 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-17T15:04:26+00:00Added an answer on June 17, 2026 at 3:04 pm

    Use an unordered list as a wrapper:

    <ul>
         <li>....col1...</li>
         <li>....col2...</li>
         <li>....col1...</li>
         <li>....col2...</li>
    </ul>
    

    Then format your list so that you float the list items in a wrapper that is twice as wide:

    ul, li {list-style:none;margin:0;padding:0}
    ul {width:400px}
    li {float:left;width:200px}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on converting the functionality of some JSP pages to GWT. I
I am fairly new to jquery and I am working with jsp and struts
I am working on a JSP site. I have 3 main concentric divs: container
I am working on a jsp page which uses a bean to create an
I'm working in a jsp. bean.getConfigurationActionButtonBar() returns a list of button objects. WebUtils.getActionButtonBar(List buttonList)
I have a page in JSP that list some file that could be downloaded
I have a jsp code working fine on one of the machines. But when
I have inherited some code that isn't quite working ... I have jsp which
I'm working with JSP pages, and I need to append some HTML and Java
I'm working with some old jsp apps and we are moving servers and so

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.