我想如下安排我的列表:顯示空格選項標籤
Subject Chapter MCQ Duration(min)
Physics 1 10 40 40
Chemistry 1 9 30 30
Math 1 10 40 40
Biology 1 12 40 20
所以,我嘗試以下操作:
<div style="font-family: "Lucida Sans Unicode"">
<?php
include_once('funcs.php');
$f = new funcs();
$res = $f->get_ques();
printf("%-'.20s", 'Subject');
printf("%-'.20s", 'Chapter');
printf("%-'.20s", 'Marks');
printf("%-'.20s", 'Duration');
?>
<br/>
<select>
<?php
while($q = mysql_fetch_array($res)) {
echo '<option>', printf("%-'-20s", $f->get_sub($q['q_id'])), printf("%-'.20s", $q['chapter']), printf("%-'.20s", $q['mcq']), printf("%-'.20s", $q['time']), '</option>';
}
?>
</select>
</div>
而且我的輸出是:
線條曲折。我想要這些線條是嚴格的。我試圖使用固定長度的字體,但失敗了。我應該刪除這些點。以及。任何人都請幫助我。
改爲使用表格,單列中的單選按鈕或複選框讓用戶選擇。你擁有的是表格數據,不能用在'select'元素給你的簡單結構中。 – 2013-02-28 07:18:25
另一個很好的解決方案。但我會先選擇 – 2013-02-28 15:32:03