我想如下安排我的列表:显示空格选项标签
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