加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 在选项标签中显示空格

发布时间:2020-12-13 17:15:29 所属栏目:PHP教程 来源:网络整理
导读:我想安排我的清单如下: Subject Chapter MCQ Duration(min)Physics 1 10 40 40Chemistry 1 9 30 30Math 1 10 40 40Biology 1 12 40 20 所以,我试过以下: div style="font-family: "Lucida Sans Unicode"" ?php include_once('funcs.php'); $f = new funcs(
我想安排我的清单如下:

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']),$q['mcq']),$q['time']),'</option>';
       }
   ?>
   </select>
</div>

我的输出是:

线是曲折的.我希望这些线条严格.我试图使用固定长度字体但失败了.我应该删除这些点.同样.有人请帮助我.

解决方法

改变这一点

echo '<option>','</option>';

echo '<option>',printf("% /&nbsp20s",'</option>';

使用& nbsp空间.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读