我有这张桌子
我的目标是有一张像这样的桌子
该表有 8 行 3 列
我已经存储了这些问题,但我很难以这种格式打印它。
其中在打印 4 个问题后,它将转到另一个单元格并再次打印 4 个问题,然后一旦已经有 3 列,它将创建一个新行并再次执行相同的步骤。(8 行和 3 列)
问题按序号排序。[在下表中,第 1 4 个问题是 1,2,3,4,然后它右边的单元格是 6,7,8,9 等等....]
我已经坚持了将近8个小时了....
这是我当前的代码:
select = "SELECT q.QuestionID, q.QuestionText, q.m, q.l, q.GroupNo, q.SequenceNo FROM question2 q Order By q.SequenceNo";
$result = mysql_query($select);
$question_id = "";
$question_text = "";
$question_m = "";
$question_l = "";
$question_group = "";
//$table = "<table border='1' cellspacing='1'>";
$count_row = 0;
$array = array();
//$count_column = 0;
while($row = mysql_fetch_array($result))
{
$question_id = $row['QuestionID'];
$question_text = $row['QuestionText'];
$question_m = $row['m'];
$question_l = $row['l'];
$question_group = $row['GroupNo'];
$question_sequence = $row['SequenceNo'];
if($count_row > 2)
{
$array[] .= "</div>";
}
$array[] .= "<div style='border=1px';'>";
$array[] .= $question_text ."<br/>";
$count_row++;
}
$table .= "</table>";
echo $table;
先生/女士,您的回答会很有帮助。谢谢++