# Collection-repeat and items with variable heights

**URL:** <https://forum.ionicframework.com/t/collection-repeat-and-items-with-variable-heights/6346>\
**Category:** ionic-v1\
**Created:** [July 2, 2014, 4:31pm UTC](https://forum.ionicframework.com/t/collection-repeat-and-items-with-variable-heights/6346 "2014-07-02T16:31:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Watto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/watto/32/64925_2.png) [@Watto](https://forum.ionicframework.com/u/Watto)\
**Post date:** [July 2, 2014, 4:31pm UTC](https://forum.ionicframework.com/t/collection-repeat-and-items-with-variable-heights/6346/1 "2014-07-02T16:31:01Z")

</div>

Hi, all. I’m using collection-repeat for a long list. As I see in documentation, we have to use collection-item-height to determinate the items height. My problem comes when I need that this heights be variable, so an item can be 100px height and other 80px depending on the content.

Can I configure the items to get this variable heights?

Thank you all.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 2, 2014, 6:59pm UTC](https://forum.ionicframework.com/t/collection-repeat-and-items-with-variable-heights/6346/2 "2014-07-02T18:59:22Z")

</div>

Right now, this is not possible. For now collection repeat needs an explicit height to be set

---

<div class="post-metadata">

**Author:** ![boopage](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@boopage](https://forum.ionicframework.com/u/boopage)\
**Post date:** [September 22, 2014, 9:46am UTC](https://forum.ionicframework.com/t/collection-repeat-and-items-with-variable-heights/6346/3 "2014-09-22T09:46:00Z")

</div>

I store the item’s height in my database, does it work if I return the height in my $scope.getItemHeight function?

I tried it, and doesn’t seems to be working, all the heights still fixed, dose it mean one height has been used for all items?

---

<div class="post-metadata">

**Author:** ![boopage](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@boopage](https://forum.ionicframework.com/u/boopage)\
**Post date:** [September 22, 2014, 10:20am UTC](https://forum.ionicframework.com/t/collection-repeat-and-items-with-variable-heights/6346/4 "2014-09-22T10:20:55Z")

</div>

It only works if collection-item-width="‘100%’", not with grid collection-item-width="‘50%’", correct?
