0

I get the JSON from the site. Some of the fields of this JSON is empty (""). I have a HTML(Jade) code like this:

 div(ng-repeat="item in itemsToDisplay", class="item tableLine")
    span(class="tableItemid")
        a(href="#/itemDetail/{{ item.Itemid }}") {{ item.Itemid }}
    span(class="tableItemdescription")
        {{ item.Itemdescription }}
    span(class="tableDate")
        {{ item.CreationDate }}
    span(class="tableCountry")
        {{ item.Address }}

And css (slylus) like this:

span.tableItemid
   col(1/15)
span.tableItemdescription
   col(3/15)
span.tableDate
   col(2/15)

If the fields is empty the span is empty. And I have offset in the responsive grid. What is the best way to avoid it?

ceth
  • 44,198
  • 62
  • 180
  • 289
  • You could use Javascript to detect if an object is empty or not (`if ($('#element').is(':empty')){//do something}`). If the object is empty you could apply a different style. Would that help? – Rotan075 Nov 06 '15 at 11:53
  • Now I'm just add a transparent image (1px), but I'm searching for more jeet specific solutions – ceth Nov 06 '15 at 11:55

0 Answers0