【问题标题】:setting the width on a fieldset in codeigniter在 codeigniter 中设置字段集的宽度
【发布时间】:2015-08-04 18:33:24
【问题描述】:

您好,我是 codeigniter 框架的初学者,我对 codeigniter 中的字段集有疑问。 我想制作一个具有一定宽度的字段集,例如我会在 html 中这样做:

    <fieldset style="width: 350px">
        <legend>Login Form</legend>  
    <?php 
    echo form_open("user/login"); 
    ?>
        <table>
    <tr> <td> <label for="user">Username:</label> </td> <td> <input type="text" id="email" name="username"  /> </td> </tr>
    <tr> <td> <label for="pass">Password:</label> </td> <td> <input type="text" id="pass" name="password"  /> </td> </tr>
    <tr> <td> <input type="reset" class="" value="Clear form" /> </td> <td> <input type="submit" class="" value="Sign in" /> </td> </tr>
        </table>
    <?php echo form_close(); ?>
    </fieldset>

我不知道如何使用活动记录来实现:

    <?php 
    echo form_fieldset('Login Form');
    echo form_open("user/login"); 
    ?>
        <table>
    <tr> <td> <label for="user">Username:</label> </td> <td> <input type="text" id="email" name="username"  /> </td> </tr>
    <tr> <td> <label for="pass">Password:</label> </td> <td> <input type="text" id="pass" name="password"  /> </td> </tr>
    <tr> <td> <input type="reset" class="" value="Clear form" /> </td> <td> <input type="submit" class="" value="Sign in" /> </td> </tr>
        </table>
    <?php 
    echo form_close(); 
    echo form_fieldset_close();
    ?>

感谢任何可以帮助我的人!

【问题讨论】:

    标签: forms codeigniter width fieldset


    【解决方案1】:

    你可以这样做

    $attributes = array('style' => 'width: 350px');
    echo form_fieldset('Login Form', $attributes);
    

    【讨论】:

      猜你喜欢
      • 2021-04-15
      • 2013-01-26
      • 2020-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多