有一个简单的问题,我似乎无法弄清楚。如果您打开 php fiddle,为什么在结果部分中最后一列没有其行跨度填充每一行?我已经包含了行跨度,就像我在其他需要行跨度的列中一样,但它不适用于该列。
有人知道是什么原因造成的吗?
http://phpfiddle.org/main/code/get-rps
全表代码:
<table id='penaltytbl'>
<thead>
<tr>
<th class='questionth'>Question No.</th>
<th class='questionth'>Question</th>
<th class='incorrectanswerth'>Incorrect Answer</th>
<th class='answermarksth'>Marks per Answer</th>
<th class='totalmarksth'>Total Marks</th>
<th class='noofmarksth'>Marks Remaining</th>
</tr>
</thead>
<tbody>
<?php
foreach($ques_ans as $questionNo => $inc_ans)
{
$q_row_span = count($inc_ans);
$row_count = 0;
$inc_ans = array_values($inc_ans);
?>
<tr class="questiontd">
<td class="questionnumtd q<?php echo$questionNo?>_qnum" rowspan="<?php echo$q_row_span?>"><?php echo$questionNo?>
<input type="hidden" name="numQuestion" value="<?php echo$questionNo?>" />
<input type="hidden" name="q<?php echo$questionNo?>_ans_org" class="q<?php echo$questionNo?>_ans_org" value="<?php echo$searchMarks[array_search($questionNo, $searchQuestionNo)]?>">
<input type="hidden" name="q<?php echo$questionNo?>_ans" class="q<?php echo$questionNo?>_ans" value="<?php echo$searchMarks[array_search($questionNo, $searchQuestionNo)]?>">
</td>
<td class="questioncontenttd" rowspan="<?php echo$q_row_span?>"><?php echo$searchQuestionContent[array_search($questionNo, $searchQuestionNo)]?> </td>
<td class="answertd"><?php echo$inc_ans[$row_count];?>
<input type="hidden" id="hiddenincorrect" name="incorrect[]" value="<?php echo$inc_ans[$row_count];?>">
</td>
<td class="answermarkstd">
<input class="individualMarks q<?php echo$questionNo?>_mark" q_group="1" name="answerMarks[]" type="text" data-type="qmark" data-qnum="<?php echo$questionNo?>" onkeypress="return isNumberKey(event)" maxlength="3" value="0" />
</td>
<td class="totalmarkstd" rowspan="<?php echo$q_row_span?>"><?php echo$totalMarks[array_search($questionNo, $searchQuestionNo)]?></td>
<td class="noofmarkstd q<?php echo$questionNo?>_ans_text" q_group="1" rowspan="<?php$q_row_span?>"><?php echo"<strong>".$searchMarks[array_search($questionNo, $searchQuestionNo)]."</strong>"?></td>
</tr>
<?php
//remaining incorrect answers in separate row (if any) follows here
if($row_count < $q_row_span - 1)
{
for($i=($row_count + 1); $i<$q_row_span; $i++) { ?>
<tr>
<td class="answertd"><?php echo$inc_ans[$i];?>
<input type="hidden" id="hiddenincorrect" name="incorrect[]" value="<?php echo$inc_ans[$i];?>">
</td>
<td class="answermarkstd">
<input class="individualMarks q<?php echo$questionNo?>_mark" q_group="1" name="answerMarks[]" type="text" data-type="qmark" data-qnum="<?php echo$questionNo?>" onkeypress="return isNumberKey(event)" maxlength="3" value="0" />
</td>
</tr>
<?php
}
}
}
?>
</tbody>
</table>