title: Spreadsheet Like Layout Using UICollectionView
body: <p>How can I use UICollectionView to create a spreadsheet like layout where each row displays properties of a single object. </p>
  
  <p>Example: </p>
  
  <pre><code>Customer Id   First Name   Last Name   Social  Address  Phone 
  </code></pre>
  
  <p>Here is what I came up with using UITableView: </p>
  
  <pre><code>funds = [[NSMutableArray alloc] init];
      columnNames = [NSArray arrayWithObjects:@"fundNumber",@"fundName",@"unitPrice",@"fundBalance",@"percentageOfAccountValue",@"futureContributionAllocation", nil];
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FundCell"];
  
      Fund *fund = [funds objectAtIndex:[indexPath row]];
  
      for(NSString *columnName in columnNames)
      {
          UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x, 0, 100, 44)];
  
          label.backgroundColor = [UIColor clearColor];
  
          label.text = [fund valueForKey:columnName];
  
          x += label.bounds.size.width;
  
          [cell addSubview:label];
  
      }
  
      x = 0;
  
      return cell;
  }
  </code></pre>
  
  <p>And here is the output: </p>
  
  <p><img src="https://i.stack.imgur.com/Btfjq.png" alt="enter image description here"></p>