Customize column of table view - iphone

Is it possible to customize the column of table view.
By default table view contains 1 column, But according to my requirement I want 4 column in table.
Means I want table like we create in MS-word/excel.
Thanks.

http://dewpoint.snagdata.com/2008/10/31/drawing-a-grid-in-a-uitableview/
ad
http://usxue.is-programmer.com/posts/14176.html
will help you

No there is no such method to do that ..... but for sure u can make a subclass of UITableViewCell such that it has 4 parts in it and all parts are seperated by a fine line (a kind of bordered image as background will do the job). You can manage your data accordingly and it may create an illusion of MS-word/excel.
But I am sure you are aware of column and row of UITableView, so you can manage all your data is this format. If you want to represent data in tabular fashion like MS-word/excel you don't have enough space as width on iPhone and If you incorporate a tableView in a scroll view, two scroll will not be user friendly.
So i suggest you to go with TableView's native behaviour for such type of task.

Related

Table View Group Header View

I want to create an effect similar to the Open Table application. I want the section header to stick to the top as I scroll the table. This is of course the default behavior with a plain table view, but because of style, I want a group table view.
Any ideas or suggestions?
One way to do it (I'd wager OpenTable does it this way) is to use a plain table style but dress the cells yourself as grouped. You'd need 3 background images for the cells, one for the first cell in a section (with rounded upper corners), one for the last row in a section (with rounded lower corners), and one for the others that looks like grouped cells (with left and right insets).

Best way to display data in rows and coloumn format

i am doing an app for iPhone which has to display the details of students of school i.e. their name,class name,marks in different subjects.I have to display the same in rows and columns format
Can anybody suggest me the best way to implement a 7 column table
If You only want display the information then in Custom UITableViewCell put 7 UILabels Horizontally depends on your UI.If you also want some action on them then put UIButtons in place of UILabel.

Is there a way to stack up the cells of a table side by side?

What i mean by this is that cell1 would be top left. Cell2 would be top right. Cell 3 would be below cell 1, cell 4 would be below cell 2 etc..
Is there a way to do this?
UITableView does not support this out-of-the-box. You can fake it, but you might also want to try using something like AQGridView.
The UITableView only allows for one column, so it's really more of a stack or list than a table. To do what you are talking about you will need to create a custom UITableViewCell either in Interface Builder or code that "fakes" columns through layout, but you will only ever have one cell per row.
From the Documentation:
A table view in the UIKit framework is
limited to a single column because it
is designed for a device with a small
screen.

Does UITableView support grouped style with rectangular (not rounded) sections?

I would like to present a UITableView with a basic layout like this:
header view
table row
table row
table row
header view
table row
table row
Grouped style with section header views is the natural way to do this, but I don't want the "shunken (padding on the left and the right), rounded corner" look that grouped sections have. I'd like the look to be like an indexed plain table: table rows are all rectangular and full-width, with periodic header sections to separate the table rows into groups.
Is this possible with a grouped style table? Or can I simulate this with a plain table and custom content views for the section headers? Or is there another way to do this? I'd like to reuse as much of UITableView as possible, without having to write a full custom control.
I'd go for the second option you presented. What you can do is use the delegate methods viewForHeaderInSection and viewForFooterInSection.

Can I really have just one column in UITableView?

From the docs:
A table view in the UIKit framework is limited to a single column because it is designed for a device with a small screen.
Have look in the developer docuementation A Closer Look at Table-View Cells how to setup multiple columns in a table view cell.
Yes... unless you add subview in cell that looks like more than one column...
i.e 2 label in each cell with same size and horizontally aliened can look like Table with 2 column...
What about putting another tableview next to that one and synchronize the movement (scrolling)? :)