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

  • Home
  • SEARCH
  • 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 8449035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:35:27+00:00 2026-06-10T10:35:27+00:00

I have a table with 2 rows with each 3 columns in it and

  • 0

I have a table with 2 rows with each 3 columns in it and an Array with 5 values. These values should be displayed successively in the 3 columns, e.g.

indexPath.row 0: Array[0] | Array[1] | Array[2]
indexPath.row 1: Array[3] | Array[4] | 

I want to create some coding, which puts my values (it doesn’t care how much e.g. 5,6,7,…,20,21 in the format of 3 columns in rows) the rows are calculated at the size of the array with the values.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{    
    NSMutableArray *values = [... getValues];
    int no=0;
    if (values) {
        no=(values.count+1)/3;
    }
    else{
        no=0;
    }
    return no;
}

My current problem is, I don’t get the 5 values distributed in the columns.
I’m struggeling around with the calculation, these won’t fit with the index of the array …

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//order values in 3 columns and 2 rows (currently)...
}

BR,
mybecks

  • 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-10T10:35:29+00:00Added an answer on June 10, 2026 at 10:35 am

    Found a solution.

    NSInteger count = numberOfValues;
    NSInteger start = indexPath.row * 3;
    NSInteger end = MIN(start + 3, count);
    
    for(int i = start; i < end; i++)
    {
      if(i%3 == 0){//left}
      if(i%3 == 1){//center}
      if(i%3 == 2){//right}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with many rows and each row has select lists. Something
I have a table with multiple rows in each row is a select list
I have a table with 3 rows. Each row has 3 td. The first
I have this kind of table, it has many rows and each row has
I have three tables with 5 columns each. They can grow upto 15 rows
I have a table with one column and four rows. Each tr has a
I have a table where each rows has a check box. This code works
I have a table which is zebra-striped (different background color for each odd rows).
In each table have many number of rows with amount. Like this i have
I have an table. I need to iterate, for each(datarow r in datatable.rows){ foreach(datacolumns

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.