Q:

row span not working proper in dynamic generated html content via jquery

<table>
  <tr>
     <td rowspan="2">test</td>
     <td>test</td>
  </tr>
  <tr>
     <td rowspan="0">test</td>
     <td>test</td>
  </tr>
</table>    

$.each(data.shopTimeArray,function(i)
{
    $tbodyTR = $("<tr>",{}).appendTo($tbody);
    $tbodyTH = $("<th>",{'scope':'row','html':data.shopTimeArray[i].slice(0,-3)}).appendTo($tbodyTR);
    $.each(data.workerids,function(j)
    {
        $.each(data.workerAppointments[data.workerids[j]],function(k)
        {
           if(data.workerAppointments[data.workerids[j]][k].timeArray != "undefined") {
                $.each(data.workerAppointments[data.workerids[j]][k].timeArray,function(y){
                    $rowSpan++;
                });
                } else {
                    $rowSpan = 0;
                }
        });
    });
    $tbodyTD = $("<td>",{'class':classname,'onclick':click,'html':html,'rowspan':$rowSpan,'data-time':time,'workerid':data.workerids[j]}).appendTo($tbodyTR);
});

{"shopTimeArray":["10:00:00","10:15:00","10:30:00","10:45:00","11:00:00","11:15:00","11:30:00","11:45:00","12:00:00"],"workernames":["Kapper 1","Kapper 2"],"workerTimes":{"148":["10:00:00","10:15:00","10:30:00","10:45:00","11:00:00","11:15:00","11:30:00","11:45:00","12:00:00"],"196":["10:00:00","10:15:00","10:30:00","10:45:00","11:00:00","11:15:00","11:30:00","11:45:00","12:00:00"]},"workerAppointments":{"148":[{"timeArray":["10:00:00","10:15:00","10:30:00","10:45:00"]}],"196":[{"timeArray":["09:30:00","09:45:00"]},"workerids":["148","196"],"today":"2017-06-19","dayname":"1"}

Here i m creating dynamic html,
i want to skip next 5 td if there is a rowspan = 5
value want to skip is in workerAppointments[workerid][timearray]
Looking for help 
https://imgur.com/a/xCais "tooltip"
Look i add table which is generated by jquery you can see in table if rowspan = 2 than in next tr first td will not add, but by my above jquery code it add create like above table.

A:

You could have a variable called skipColumnCount and in your inner loop do something like
if (skipColumnCount > 0) {
    skipColumnCount--;
    continue;
}

So, to skip 5 columns, you'd set it equal to 5.

