[Solved] Can not create dynamic html using ajax call
You need to check the length of the passengers then chose the right colclass like : $.each(data.driver_data, function(key, val) { var pdetails = val.passenger_data; output += ‘<div class=”row”>’; output += ‘<div class=”col-md-4 driver”><div><label class=”header”><b>Driver Details</b></label></div><div><label>Name:</label><span class=”dname”>’ + val.employeename + ‘</span></div><div><label>Vehicle No:</label><span class=”dname”>’ + val.vehicleno + ‘</span></div><div><label>Mobile:</label><span class=”dname”>’ + val.mobilenumber + ‘</span></div></div>’; var colclass=”8″; var pdetails_length … Read more