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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:20:38+00:00 2026-05-27T03:20:38+00:00

I was hoping some would know how to tile a grid across. I have

  • 0

I was hoping some would know how to tile a grid across. I have some code to get started

1 | 2
3 | 4
5 | 6

and in my ajax function

$.ajax({
  complete:function(result) {
      // in here i want to tile across two sets of td's for each tr
      for(var i = 0; i < products.length; i++) {
          $('#products').append('<tr><td>' + products[i].Title + '</td></tr>');
      }
  }
});  
<table id="products"></table>
  • 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-27T03:20:39+00:00Added an answer on May 27, 2026 at 3:20 am

    This works whatever the products size is (even or odd).
    Hope with comments make it easy to understand

    var table_body = '< tbody>';
    for(var i = 0; i < products.length; i++) {
        if(i%2==0)//if even we open a row
             table_body += '<tr>';
    
        //We always put a value  
        table_body += '<td>' + products[i].Title + '</td>';
    
        if(i%2!=0 || (i==products.length-1))//if odd we close a row
             table_body += '</tr>';
    
    }
    
    table_body += '< /tbody>';
    $('#products').append(table_body);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was hoping to get some advice on what to do. I have a
I have a problem that I'm hoping to get some direction in solving -
I was hoping some of you guru's out there know the answer to this
I am having troubles with jQuery's load function and am hoping for some help.
I was hoping to get some help with my SQL Server script. Basically, I
I'm hoping people have some ideas to help solve this problem. I am developing
I am working on some legacy code, and I have the following wonderful issue.
Strange one here, hoping to get some feedback to point me in the right
I know this was not possible in C++03, but I'm hoping there is some
I'm using js-test-driver to run some tests and would like to test some code

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.