How can I dynamically create rows in Jade? - node.js

Right now I have this:
- count = 0
- each organization in organizations
if (count == 0 || count % 3 == 0)
.row
.col-md-4
a(href="#{organization.url}" target="_blank")
.fancyy-box
h3= organization.name
img(src="/images/organizations/#{organization.logo}")
p= organization.mission
- count = count + 1
What I am trying to do is start a new row every third organization, so that I get:
<div class="row">
<div class="organization">...</div>
<div class="organization">...</div>
<div class="organization">...</div>
</div>
<div class="row">
<div class="organization">...</div>
<div class="organization">...</div>
<div class="organization">...</div>
</div>
// and so on...
Right now I am getteing:
<div class="row" />
<div class="organization">...</div>
<div class="organization">...</div>
<div class="organization">...</div>
<div class="row" />
<div class="organization">...</div>
<div class="organization">...</div>
<div class="organization">...</div>
<div class="row" />
Is there an easy way to accomplish this?

Like Mukesh Soni said you need to think about your indentation. But this is just one part of your problem, the second thing I recognized is your conditional statement and your loop. I edited this a little bit like you can see below:
- for (var j = 0; j < organizations.length; j++)
if (j == 0 || j % 3 == 0)
.row
- for (var i = j; i < (3 + j); i++ )
- if (i >= organizations.length) break;
.col-md-4
a(href="#{organizations[i].url}" target="_blank")
.fancyy-box
h3= organizations[i].name
img(src="/images/organizations/#{organizations[i].logo}")
p= organizations[i].mission
So in the first for loop I simply post a row every three times of iteration, in the second for loop I add your data, simply by adding 3 lines / divs. If i gets bigger then your data - it breaks.
Here an example: first my data
{
organizations: [
{name: 'demo1', url: 'example.com', logo: 'pic1.jpg', mission: '1'},
{name: 'demo2', url: 'anotherexample.com', logo: 'pic2.jpg', mission: '2'},
{name: 'demo3', url: 'justanotherexample.com', logo: 'pic3.jpg', mission: '3'},
{name: 'demo4', url: 'wowjustanotherexample.com', logo: 'pic4.jpg', mission: '4'}]
}
Now the HTML output:
<div class="row">
<div class="col-md-4">
<a href="example.com" target="_blank">
<div class="fancyy-box">
<h3>demo1</h3><img src="/images/organizations/pic1.jpg"/>
<p>1</p>
</div>
</a>
</div>
<div class="col-md-4">
<a href="anotherexample.com" target="_blank">
<div class="fancyy-box">
<h3>demo2</h3><img src="/images/organizations/pic2.jpg"/>
<p>2</p>
</div>
</a>
</div>
<div class="col-md-4">
<a href="justanotherexample.com" target="_blank">
<div class="fancyy-box">
<h3>demo3</h3><img src="/images/organizations/pic3.jpg"/>
<p>3</p>
</div>
</a>
</div>
</div>
<div class="row">
<div class="col-md-4">
<a href="wowjustanotherexample.com" target="_blank">
<div class="fancyy-box">
<h3>demo4</h3><img src="/images/organizations/pic4.jpg"/>
<p>4</p>
</div>
</a>
</div>
</div>

You could do this
.row
each organization, i in organizations
if i > 0 && i % 3 === 0
// jade/pug can interpret html
</div><div class="row">
// past you col template here
.col-md-4
a(href="#{organizations[i].url}" target="_blank")
.fancyy-box
...

Related

Apply style to all nested li div's excluding the first li div

No matter what I've tried to either target or exclude the first li div, nothing works. I tried :not(and different variations of the selectors here) but that didn't work. On one occasion, the result rendered as though looking into a mirror that's facing a mirror. No bueno. No classes or ids can be added--representative example below.
ul {
list-style-type: none;
}
.message-content-wrap {
background-color: red;
}
<ul id="thread-list" class="group-message-thread">
<li>
<div class="message-wrap group-messages-highlight">
<div class="avatar-wrap"></div>
<div class="message-content">
<div class="message-content-wrap">
<p>This is content in the first message</p>
</div>
</div>
</div>
</li>
<li>
<div class="message-wrap">
<div class="avatar-wrap"></div>
<div class="message-content">
<div class="message-content-wrap">
<p>This is content in the second message</p>
</div>
</div>
</div>
</li>
<li>
<div class="message-wrap">
<div class="avatar-wrap"></div>
<div class="message-content">
<div class="message-content-wrap">
<p>This is content in the third message</p>
<p>some text</p>
</div>
</div>
</div>
</li>
<li>
<div class="message-wrap">
<div class="avatar-wrap"></div>
<div class="message-content">
<div class="message-content-wrap">
<p>This is content in the fourth message</p>
<p>some more text</p>
</div>
</div>
</div>
</li>
</ul>
Any ideas would be most welcome. My attempt in jsfiddle
a few ways to style child elements
ul > li:not(first-of-type) {
// styles go here
}
ul > li {
// styles go here
}
ul:first-child {
}
li + li {
}

Angular hide div on click function

i am new to angular and typescript and i need to hide div section *ngIf="stu.notes != null" on save button click.
i can display the respective divs when clicked on the respective buttons, but i am not able to hide the other one.
Can anyone hep me out here.
Thanks in advance.
HTML File:
<nb-accordion-item-body>
<div class="row">
<div *ngIf="notes_area != null">
<h5> <span class="col-md-8" style="font-weight : bold; font-size : 16px;"
[innerHTML]="notes_area"></span>
</h5>
<br/>
</div>
<div class="col-md-3" *ngFor = "let stu of studentData">
<div *ngIf="stu.notes != null" >
<div class="row">
<div class="col-md-8">
<br/>
<h5 style="font-weight : bold;" > {{stu?.notes.slice(3,-4)}}
</h5>
<br/>
</div>
</div>
</div>
</div>
</div>
<br/>
<div class="row" *ngIf="addNote == true">
<div class="col-md-6">
<tinymce [(ngModel)] = "notes" ></tinymce>
</div>
<div class="col-md-6">
<button nbButton (click)="saveNotes()">Save</button>
</div>
</div>
</nb-accordion-item-body>
.ts File:
saveNotes() {
this.api.saveNotes(this.my_app_data[0].app_id,this.notes).subscribe(data => {
this.notes_area = data['data'];
console.log(this.app_id);
console.log('log',this.notes);
});
}

Vue not opens .json file with axios hook

Making my first steps in vue. I am crashing in importing a .json file. This job concernes a small shop. Goal of this paragraph is to enter 4 products in the shop. The productfiles are imported with an Axios hook. But the Vue Dev Tool errors an undefined (see picture). When loading the website the div with v-else is automatically loaded.
The products.json files is nested in the same folder as index.html. http://localhost:8000/products.json shows me the .json file.
Here you 'll find all the code for this small shop. Even with a copy/paste of this code mine is not working. I also made it smaller with the relevant code:
<!DOCTYPE html>
<html>
<head>
<title>Vue.js Pet Depot</title>
<script src="https://unpkg.com/vue"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="assets/css/app.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.2/axios.js"></script>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div id="app">
<header>
<div class="navbar navbar-default">
<div class="navbar-header">
<h1>{{ sitename }}</h1>
</div>
<div class="nav navbar-nav navbar-right cart">
<button type="button" class="btn btn-default btn-lg" v-on:click="showCheckout">
<span class="glyphicon glyphicon-shopping-cart">{{ cartItemCount}}</span> Checkout
</button>
</div>
</div>
</header>
<main>
<div v-if="showProduct"> <!--not working-->
<div v-for="product in sortedProducts">
<div class="row">
<div class="col-md-5 col-md-offset-0">
<figure>
<img class="product" v-bind:src="product.image">
</figure>
</div>
<div class="col-md-6 col-md-offset-0 description">
<h1 v-text="product.title"></h1>
<p v-html="product.description"></p>
<p class="price">
{{product.price | formatPrice}}
</p>
<button class=" btn btn-primary btn-lg" v-on:click="addToCart(product)" v-if="canAddToCart(product)">Add to cart</button>
<button disabled="true" class=" btn btn-primary btn-lg" v-else>Add to cart</button>
<span class="inventory-message" v-if="product.availableInventory - cartCount(product.id) === 0">
All Out!
</span>
<span class="inventory-message" v-else-if="product.availableInventory - cartCount(product.id) < 5">
Only {{product.availableInventory - cartCount(product.id)}} left!
</span>
<span class="inventory-message" v-else>
Buy Now!
</span>
<div class="rating">
<span v-bind:class="{'rating-active' :checkRating(n, product)}" v-for="n in 5">
☆
</span>
</div>
</div>
<!-- end of col-md-6-->
</div>
<!-- end of row-->
<hr />
</div>
<!-- end of v-for-->
</div>
<!-- end of showProduct-->
<div v-else>
<!--skipped this part-->
</div>
</main>
</div>
<!-- end of app-->
</div>
<script type="text/javascript">
var APP_LOG_LIFECYCLE_EVENTS = true;
var webstore = new Vue({
el: '#app',
data: {
sitename: "Vue.js Pet Depot",
showProduct: true,
a: false,
states: []
},
order: []
},
products: [],
cart: []
},
methods: {
checkRating(n, myProduct) {
return myProduct.rating - n >= 0;
},
addToCart(aProduct) {
this.cart.push(aProduct.id);
},
showCheckout() {
this.showProduct = this.showProduct ? false : true;
},
submitForm() {
alert('Submitted');
},
canAddToCart(aProduct) {
//return this.product.availableInventory > this.cartItemCount;
return aProduct.availableInventory > this.cartCount(aProduct.id);
},
cartCount(id) {
let count = 0;
for (var i = 0; i < this.cart.length; i++) {
if (this.cart[i] === id) {
count++;
}
}
return count;
}
},
computed: {
cartItemCount() {
return this.cart.length || '';
},
sortedProducts() {
if (this.products.length > 0) {
let productsArray = this.products.slice(0);
console.log(productsArray);
console.log(this.products);
function compare(a, b) {
if (a.title.toLowerCase() < b.title.toLowerCase())
return -1;
if (a.title.toLowerCase() > b.title.toLowerCase())
return 1;
return 0;
}
return productsArray.sort(compare);
}
}
},
filters: {
formatPrice(price) { //#B
..
}
},
beforeCreate: function () { //#B
if (APP_LOG_LIFECYCLE_EVENTS) { //#B
..
},
created: function () {
axios.get('./products.json')
.then((response) => {
this.products = response.data.products;
console.log(this.products);
});
},
beforeMount: function () {
..
},
mounted: function () {
..
},
beforeUpdate: function () {
..
},
updated: function () {
..
},
beforeDestroyed: function () {
..
},
destroyed: function () {
..
}
});
</script>
</body>
</html>
I tried out the same code here and it's working fine, i had did axios call to this json file :
https://raw.githubusercontent.com/ErikCH/VuejsInActionCode/master/chapter-05/products.json
<!DOCTYPE html>
<html>
<head>
<title>Vue.js Pet Depot</title>
<script src="https://unpkg.com/vue"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="assets/css/app.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.2/axios.js"></script>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div id="app">
<header>
<div class="navbar navbar-default">
<div class="navbar-header">
<h1>{{ sitename }}</h1>
</div>
<div class="nav navbar-nav navbar-right cart">
<button type="button" class="btn btn-default btn-lg" v-on:click="showCheckout">
<span class="glyphicon glyphicon-shopping-cart">{{ cartItemCount}}</span> Checkout
</button>
</div>
</div>
</header>
<main>
<div v-if="showProduct">
<div v-for="product in sortedProducts">
<div class="row">
<div class="col-md-5 col-md-offset-0">
<figure>
<img class="product" v-bind:src="product.image">
</figure>
</div>
<div class="col-md-6 col-md-offset-0 description">
<h1 v-text="product.title"></h1>
<p v-html="product.description"></p>
<p class="price">
{{product.price | formatPrice}}
</p>
<button class=" btn btn-primary btn-lg" v-on:click="addToCart(product)" v-if="canAddToCart(product)">Add to cart</button>
<button disabled="true" class=" btn btn-primary btn-lg" v-else>Add to cart</button>
<span class="inventory-message" v-if="product.availableInventory - cartCount(product.id) === 0">All Out!
</span>
<span class="inventory-message" v-else-if="product.availableInventory - cartCount(product.id) < 5">
Only {{product.availableInventory - cartCount(product.id)}} left!
</span>
<span class="inventory-message" v-else>Buy Now!
</span>
<div class="rating">
<span v-bind:class="{'rating-active' :checkRating(n, product)}" v-for="n in 5">☆
</span>
</div>
</div>
<!-- end of col-md-6-->
</div>
<!-- end of row-->
<hr />
</div>
<!-- end of v-for-->
</div>
<!-- end of showProduct-->
<div v-else>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-info">
<div class="panel-heading">Pet Depot Checkout</div>
<div class="panel-body">
<div class="form-group">
<div class="col-md-12">
<h4>
<strong>Enter Your Information</strong>
</h4>
</div>
</div>
<div class="form-group">
<div class="col-md-6">
<strong>First Name:</strong>
<input v-model.trim="order.firstName" class="form-control" />
</div>
<div class="col-md-6">
<strong>Last Name:</strong>
<input v-model.trim="order.lastName" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<strong>Address:</strong>
</div>
<div class="col-md-12">
<input v-model.trim="order.address" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<strong>City:</strong>
</div>
<div class="col-md-12">
<input v-model.trim="order.city" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<strong>State:</strong>
<select v-model="order.state" class="form-control">
<option disabled value="">State</option>
<option v-for="(state, key) in states" v-bind:value="state">
{{key}}
</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<strong>Zip / Postal Code:</strong>
<input v-model.number="order.zip" class="form-control" type="number" />
</div>
</div>
<div class="form-group">
<div class="col-md-6 boxes">
<input type="checkbox" id="gift" value="true" v-bind:true-value="order.sendGift" v-bind:false-value="order.dontSendGift" v-model="order.gift">
<label for="gift">Ship As Gift?</label>
</div>
</div>
<!-- end of form-group -->
<div class="form-group">
<div class="col-md-6 boxes">
<input type="radio" id="home" v-bind:value="order.home" v-model="order.method">
<label for="home">Home</label>
<input type="radio" id="business" v-bind:value="order.business" v-model="order.method">
<label for="business">Business</label>
</div>
</div>
<!-- end of form-group-->
<div class="form-group">
<div class="col-md-6">
<button type="submit" class="btn btn-primary submit" v-on:click="submitForm">Place Order</button>
</div>
<!-- end of col-md-6-->
</div>
<!-- end of form-group-->
<div class="col-md-12 verify">
<pre>
First Name: {{order.firstName}}
Last Name: {{order.lastName}}
Address: {{order.address}}
City: {{order.city}}
Zip: {{order.zip}}
State: {{order.state}}
Method: {{order.method}}
Gift: {{order.gift}}
</pre>
</div>
<!-- end of col-md-12 verify-->
</div>
<!--end of panel-body-->
</div>
<!--end of panel panel-info-->
</div>
<!--end of col-md-10 col-md-offset-1-->
</div>
<!--end of row-->
</div>
</main>
</div>
<!-- end of app-->
</div>
<script type="text/javascript">
var APP_LOG_LIFECYCLE_EVENTS = true;
var webstore = new Vue({
el: '#app',
data: {
sitename: "Vue.js Pet Depot",
showProduct: true,
a: false,
states: {
AL: 'Alabama',
AK: 'Alaska',
AR: 'Arizona',
CA: 'California',
NV: 'Nevada'
},
order: {
firstName: '',
lastName: '',
address: '',
city: '',
zip: '',
state: '',
method: 'Home Address',
business: 'Business Address',
home: 'Home Address',
gift: '',
sendGift: 'Send As A Gift',
dontSendGift: 'Do Not Send As A Gift'
},
products: {},
cart: []
},
methods: {
checkRating(n, myProduct) {
return myProduct.rating - n >= 0;
},
addToCart(aProduct) {
this.cart.push(aProduct.id);
},
showCheckout() {
this.showProduct = this.showProduct ? false : true;
},
submitForm() {
alert('Submitted');
},
canAddToCart(aProduct) {
//return this.product.availableInventory > this.cartItemCount;
return aProduct.availableInventory > this.cartCount(aProduct.id);
},
cartCount(id) {
let count = 0;
for (var i = 0; i < this.cart.length; i++) {
if (this.cart[i] === id) {
count++;
}
}
return count;
}
},
computed: {
cartItemCount() {
return this.cart.length || '';
},
sortedProducts() {
if (this.products.length > 0) {
let productsArray = this.products.slice(0);
function compare(a, b) {
if (a.title.toLowerCase() < b.title.toLowerCase())
return -1;
if (a.title.toLowerCase() > b.title.toLowerCase())
return 1;
return 0;
}
return productsArray.sort(compare);
}
}
},
filters: {
formatPrice(price) { //#B
if (!parseInt(price)) {
return "";
} //#C
if (price > 99999) { //#D
var priceString = (price / 100).toFixed(2); //#E
var priceArray = priceString.split("").reverse(); //#F
var index = 3; //#F
while (priceArray.length > index + 3) { //#F
priceArray.splice(index + 3, 0, ","); //#F
index += 4; //#F
} //#F
return "$" + priceArray.reverse().join(""); //#G
} else {
return "$" + (price / 100).toFixed(2); //#H
}
}
},
created: function() { //#C
axios.get('https://raw.githubusercontent.com/ErikCH/VuejsInActionCode/master/chapter-05/products.json')
.then((response) => {
this.products = response.data.products;
// console.log(this.products);
});
}
});
</script>
</body>
</html>

How to render jade layout with loop of users

I am trying to render something like it:
<div class="row">
<div class"test">
User 1
</div>
<div class"test">
User 2
</div>
<div class"test">
User 3
</div>
</div>
<div class="row">
<div class"test">
User 4
</div>
<div class"test">
User 5
</div>
<div class"test">
User 6
</div>
</div>
I need 3 .test for each .row:
- var count = 0
div.row
for user in Users
- count++
-if ((count % 3) == 0)
div.test
| #{user.name}
div.row
-else
div.test
| #{user.name}
But, it does not working because when the loop try to render "div.row" its automatically close the tag.
The wrong result is:
<div class="row"></div>
<div class="test">User 1</div>
<div class="test">User 2</div>
<div class="test">User 3</div>
<div class="row"></div>
<div class="test">User 4</div>
<div class="test">User 5</div>
<div class="test">User 6</div>
<div class="row"></div>
One of possible ways is to reorganize your Users array before you send it to jade.
Users = [[user1,user2,user3],[user4,user5,user6],...
And then in jade
for group in Users
div.row
for user in group
div.test
| #{user.name}
var test = [{'1':'a','t':0},{'2':'b','t':0},{'3':'c','t':0},{'4':'d','t':0},{'5':'e','t':0},{'6':'f','t':0},{'8':'h','t':0},{'9':'i','t':0}];
//console.log(test)
var i=1;
var j=1;
_.each(test,function(t){
t.g = j;
if((i % 3) == 0){
j++;
}
i++;
return(t);
});
var test2 = _.groupBy(test,function(t){return t.g});
console.log(test2);

How to iterate objects in ectjs

Here is my code,
<div id="main" class="container">
<% for danceCategory, i in #danceStyle : %>
<% if #i? % 2 == 0 : %>
<div class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png' />
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div>
<!-- <span class="heading_first"> #{danceCategory.category} </span> -->
<span class="heading_second"> <%- #danceCategory.category %> </span>
</div>
<ul class="dance_type">
</ul>
</div>
</div>
</div>
<% else : %>
<p>List is empty</p>
<% end %>
<% end %>
</div>
I am trying to iterate the dance categories.
Question :
How can can get the index of the iteration (i in this case)
<%- #danceCategory.category %> Not displaying any values (But I am
passing the values from node)
Something like this should do it, making sure that when you access the variables within the template you don't use the '#' accessor:
<div id="main" class="container">
<% for danceCategory, idx in #danceStyle : %>
<span>The index is <%= idx %> and category is <%= danceCategory.category %></span>
<% if idx % 2 == 0 : %>
<div class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png' />
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div>
<span class="heading_second"> <%= danceCategory.category %> </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div>
<% else : %>
<p>List is empty</p>
<% end %>
<% end %>
</div>
Params:
{
title : 'Hello, world!',
id : 'main',
danceStyle: [
{ category : 'Contemporary', type : 'Traditional Jazz' },
{ category : 'Skanking', type : 'Native American' },
{ category : 'Shuffling', type : 'Traditional Jazz' },
{ category : 'Chicago stepping', type : 'Native American' },
{ category : 'Detroit Ballroom', type : 'Traditional Jazz' },
{ category : 'Disco dancing', type : 'Native American' },
{ category : 'Drunken Sailor', type : 'Traditional Jazz' },
{ category : 'Linya vrak dance', type : 'Native American' },
{ category : 'Swing', type : 'Traditional Jazz' },
{ category : 'Stomp dance', type : 'Native American' },
{ category : 'Texas Swingout', type : 'Traditional Jazz' },
{ category : 'Texas slidethrough', type : 'Native American' },
{ category : 'Texas Tommy', type : 'Traditional Jazz' },
{ category : 'Skanking', type : 'Native American' },
{ category : 'Ballroom', type : 'Traditional Jazz' }
],
upperHelper : function (string) {
return string.toUpperCase();
}
}
Output
<!DOCTYPE html>
<html>
<head>
<title>Hello, world!</title>
</head>
<body>
<div id="main" class="container"> <span>The index is 0 and category is Contemporary</span>
<div class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Contemporary </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 1 and category is Skanking</span>
<p>List is empty</p> <span>The index is 2 and category is Shuffling</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Shuffling </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 3 and category is Chicago stepping</span>
<p>List is empty</p> <span>The index is 4 and category is Detroit Ballroom</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Detroit Ballroom </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 5 and category is Disco dancing</span>
<p>List is empty</p> <span>The index is 6 and category is Drunken Sailor</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Drunken Sailor </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 7 and category is Linya vrak dance</span>
<p>List is empty</p> <span>The index is 8 and category is Swing</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Swing </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 9 and category is Stomp dance</span>
<p>List is empty</p> <span>The index is 10 and category is Texas Swingout</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Texas Swingout </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 11 and category is Texas slidethrough</span>
<p>List is empty</p> <span>The index is 12 and category is Texas Tommy</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Texas Tommy </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div> <span>The index is 13 and category is Skanking</span>
<p>List is empty</p> <span>The index is 14 and category is Ballroom</span>
<div
class="row">
<div class="col-md-5 zero_padding" align="center">
<img class="img-responsive" src='image/bollywood_master_class_image.png'
/>
</div>
<div class="col-md-7 zero_padding">
<div class="content_right">
<div> <span class="heading_second"> Ballroom </span>
</div>
<ul class="dance_type"></ul>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="left">Generated by ECT</div>
<div class="right">page: main</div>
</div>
</body>
</html>
For info, I have tested this on ectjs.com as I couldn't replicate it on jsfiddle and it works. Below is the screenshot of the above issue:

Resources