[FIXED] creating a table in ionic


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:

enter image description here

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

  <a class="item" href="#">




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 ng-app="ionicApp">

    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <title>Ionic Template</title>

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>

  <body ng-controller="MyCtrl as ctrl">
    <ion-header-bar class="bar-stable">
        <h1 class="title">Service Provider Details</h1>
        <div class="row header">
          <div class="col">Utility Company Name</div>
          <div class="col">Service Code</div>
          <div class="col">Pay Limit</div>
          <div class="col">Account Number to Use</div>
          <div class="col"></div>
        <div class="row" ng-repeat="data in ctrl.data">
          <div class="col">{{data.name}}</div>
          <div class="col">{{data.code}}</div>
          <div class="col">LK {{data.limit}}</div>
          <div class="col">{{data.account}}</div>
          <div class="col"><button class="button" ng-click="ctrl.add($index)">Add</button></div>



body {
    cursor: url('http://ionicframework.com/img/finger.png'), auto;

.header .col {

.col {
    border: solid 1px grey;
    border-bottom-style: none;
    border-right-style: none;

.col:last-child {
    border-right: solid 1px grey;

.row:last-child .col {
    border-bottom: solid 1px grey;


angular.module('ionicApp', ['ionic'])

.controller('MyCtrl', function($scope) {

    var ctrl = this;

    ctrl.add = add;
    ctrl.data = [
            name: "AiA",
            code: "AI101",
            limit: 25000,
            account: "Life Insurance"
            name: "Cargills",
            code: "CF001",
            limit: 30000,
            account: "Food City"

    function add(index) {
        window.alert("Added: " + index);

Answered By – jpoveda

Answer Checked By – Cary Denson (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published