tags:

views:

27

answers:

2

I have a set of data in a matrix which I would like to display in my iPhone app with all of the rows and columns intact. Everything I can find on the web dealing with "tables iPhone" gives me information on UITableView, which only lets you show a list of items to the user - not an actual table in the HTML sense. What's the best way on the iPhone to display an actual table of data to the user, with column & row headings and table cells?

A: 

The UITableView class was specifically designed to only show one column at a time due to the small size of the screen. If the data of your application absolutely needs to be laid out in one big grid on one screen the right way to do it, would be to add each cell as a subview to a custom view. Then implement the layoutSubviews method on your custom view to lay out the frames of the subviews in the grid you want.

kasperjj
A quick trip to google shows several open source projects that implement different layout algorithm for UIView subviews... perhaps something like this: http://code.google.com/p/layoutmanagers/ would solve your problem.
kasperjj
A: 

The solution that I found was simply to use a UIWebView. Then I can build the HTML table dynamically and load it into the web view.

Jason