Cedulio Cezar Cedulio Cezar - 1 year ago 71
iOS Question

How to show a table inside a uitableviewcell

I've been searching a way to show a table, with mutable number of columns and lines, inside a uitableviewcell to present data.

I don't know if i'm searching in the wrong place or there isn't a easy to achieve this.


I need to put something like this inside a uitableviewcell.

What I'm willing to do is to put a uiviewcollection inside a uitableviewcell and build a customlayout with headers and limit the number of columns and in some way control the flow of cells displayed inside this uicollectionview.

Answer Source

I need to put something like this inside a uitableviewcell - do you? Why?

This isn't a very mobile friendly way to view that data. Is this something you need to do, or something you think you need to do?

Often times developers will come from other backgrounds and try to use web design on a mobile, or management will ask for something that doesn't make sense. Its up to you to take these requirements and make it work on a mobile. This doesn't always mean delivering exactly a matching picture of what was asked.

If there are varying numbers of rows, I would first of all say that each row needs to be a cell, not the entire thing as a cell. I would suggest looking at something like:

Overall | With Managers | Pay | Holidays - as a tableView section header (assuming it needs to be part of a bigger tableView).

and then having:

management     7   |    7    |    6    |   7

as one cell, and

management     7   |    7    |    6    |   7

as another and so on for the rest of the section.

If there will be a varying number of columns as well. I would suggest breaking it up into a master / detail style view. Where you have cells like:

Middle Management     >
Lower Management      >

and then clicking one of these will bring you to a screen with a full break down of each column (each column probably being a cell in this case).

Its never a good idea to try pack a huge amount of content into a single cell. And you should avoid at all costs having a scrollable cell.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download