Last table column does not have rowspan operating as it should do
<p>Got a simple question which I can't seem to figure out. If you open up the php fiddle, how come in the result section that the last column does not have its rowspan fill each row? I have included the rowspan like I have in the other columns which requires rowspan but it does not work for this column.</p>

<p>Does anybody know what is causing this?</p>

<p><a href="http://phpfiddle.org/main/code/get-rps" rel="nofollow">http://phpfiddle.org/main/code/get-rps</a></p>

<p>Full table code:</p>

<pre><code>&lt;table id='penaltytbl'&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class='questionth'&gt;Question No.&lt;/th&gt;
&lt;th class='questionth'&gt;Question&lt;/th&gt;
&lt;th class='incorrectanswerth'&gt;Incorrect Answer&lt;/th&gt;
&lt;th class='answermarksth'&gt;Marks per Answer&lt;/th&gt;
&lt;th class='totalmarksth'&gt;Total Marks&lt;/th&gt;
&lt;th class='noofmarksth'&gt;Marks Remaining&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;?php

foreach($ques_ans as $questionNo =&gt; $inc_ans)
{
    $q_row_span = count($inc_ans);
    $row_count = 0;
    $inc_ans = array_values($inc_ans);

?&gt;

&lt;tr class="questiontd"&gt;

&lt;td class="questionnumtd q&lt;?php echo$questionNo?&gt;_qnum" rowspan="&lt;?php echo$q_row_span?&gt;"&gt;&lt;?php echo$questionNo?&gt;
&lt;input type="hidden" name="numQuestion" value="&lt;?php echo$questionNo?&gt;" /&gt;
    &lt;input type="hidden" name="q&lt;?php echo$questionNo?&gt;_ans_org" class="q&lt;?php echo$questionNo?&gt;_ans_org" value="&lt;?php echo$searchMarks[array_search($questionNo, $searchQuestionNo)]?&gt;"&gt;
    &lt;input type="hidden" name="q&lt;?php echo$questionNo?&gt;_ans" class="q&lt;?php echo$questionNo?&gt;_ans" value="&lt;?php echo$searchMarks[array_search($questionNo, $searchQuestionNo)]?&gt;"&gt;
    &lt;/td&gt;

    &lt;td class="questioncontenttd" rowspan="&lt;?php echo$q_row_span?&gt;"&gt;&lt;?php echo$searchQuestionContent[array_search($questionNo, $searchQuestionNo)]?&gt; &lt;/td&gt;

&lt;td class="answertd"&gt;&lt;?php echo$inc_ans[$row_count];?&gt;
&lt;input type="hidden" id="hiddenincorrect" name="incorrect[]" value="&lt;?php echo$inc_ans[$row_count];?&gt;"&gt;
&lt;/td&gt;

&lt;td class="answermarkstd"&gt;
&lt;input class="individualMarks q&lt;?php echo$questionNo?&gt;_mark"  q_group="1" name="answerMarks[]" type="text" data-type="qmark" data-qnum="&lt;?php echo$questionNo?&gt;" onkeypress="return isNumberKey(event)" maxlength="3" value="0" /&gt;
&lt;/td&gt;


&lt;td class="totalmarkstd" rowspan="&lt;?php echo$q_row_span?&gt;"&gt;&lt;?php echo$totalMarks[array_search($questionNo, $searchQuestionNo)]?&gt;&lt;/td&gt;

&lt;td class="noofmarkstd q&lt;?php echo$questionNo?&gt;_ans_text"  q_group="1" rowspan="&lt;?php$q_row_span?&gt;"&gt;&lt;?php echo"&lt;strong&gt;".$searchMarks[array_search($questionNo, $searchQuestionNo)]."&lt;/strong&gt;"?&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;?php
        //remaining incorrect answers in separate row (if any) follows here
    if($row_count &lt; $q_row_span - 1) 
    {
        for($i=($row_count + 1); $i&lt;$q_row_span; $i++) { ?&gt;     
            &lt;tr&gt;
            &lt;td class="answertd"&gt;&lt;?php echo$inc_ans[$i];?&gt;
            &lt;input type="hidden" id="hiddenincorrect" name="incorrect[]" value="&lt;?php echo$inc_ans[$i];?&gt;"&gt;
            &lt;/td&gt;

            &lt;td class="answermarkstd"&gt;
            &lt;input class="individualMarks q&lt;?php echo$questionNo?&gt;_mark"  q_group="1" name="answerMarks[]" type="text" data-type="qmark" data-qnum="&lt;?php echo$questionNo?&gt;" onkeypress="return isNumberKey(event)" maxlength="3" value="0" /&gt;
            &lt;/td&gt;
            &lt;/tr&gt;
    &lt;?php
        }
    }
}

?&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</code></pre>
