I am in need of creating a table in Ionic. I thought of using Ionic grid but could not achieve what I wanted. How can I do this? Here is an image of something similar to what i want:
I can use this but how can I divide the rows like in the picture?
<div class="list">
<div class="item item-divider">
Candy Bars
</div>
<a class="item" href="#">
Butterfinger
</a>
...
</div>
The flexbox grid should do what you want. You're not clear as to what limitation you ran into, so it's hard to address your specifics.
Here's a codepen with a working sample that generates your table with the first couple rows and a header: http://codepen.io/anon/pen/pjzKMZ
HTML
CSS
Javascript
the issue of too long content @beenotung can be resolved by this css class :
example fork from @jpoveda
Simply, for me, I used
ion-row
andion-col
to achieve it. You can make it more neater by doing some changes by CSS.This should probably be a comment, however, I don't have enough reputation to comment.
I suggest you really use the table (HTML) instead of ion-row and ion-col. Things will not look nice when one of the cell's content is too long.
One worse case looks like this:
Higher fidelity example fork from @jpoveda
In Ionic 2 there's a easier way to do that. See the Ionic Docs.
It is more or less like the following: