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?
Asked
Active
Viewed 2,610 times
2 Answers
1
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
- 14,517
- 25
- 92
- 153
-
1This is precisely the solution I took and works well so long as the interaction with the items in the table are minimal. Unfortunately the minimalist interface between the world of Cocoa and the world of the HTML DOM on the iPhone makes it annoying to link the two. Another tool that I found helpful in using this technique was an HTML template engine. I settled on the MGTemplateEngine, but there are others. – Scott Thompson Feb 23 '12 at 19:54
0
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
- 3,632
- 27
- 25
-
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 Jun 17 '10 at 11:49