@Ben
I don't think that Field has a _style attribute but in SQLFORM.factory you
can use _style attribute. This style applies for all input Fields in form.
You can try this way.
 in_form = SQLFORM.factory(
        Field('userid', label='User Id: ', requires=IS_NOT_EMPTY()),
        Field('password', label='Password', type='password',
requires=IS_NOT_EMPTY()),
        formstyle='divs',
        submit_button=' Submit ',
          _style='width: 50%'
        )

If you want to apply style  on peculiar Field in the form you have to add
style tag in you View

#View
<style>
#no_table_userid{
width: 50%;
}
</style

Thanks
SP

On Mon, Feb 11, 2019 at 11:37 PM Ben Duncan <linux...@gmail.com> wrote:

> How can you over rider the default CSS in sqlform(.factory) ...
> i.e.:
>  in_form = SQLFORM.factory(
>         Field('userid', label='User Id: ', requires=IS_NOT_EMPTY(),
> _style='width: 50%'),
>         Field('password', label='Password', type='password',
> requires=IS_NOT_EMPTY()),
>         formstyle='divs',
>         submit_button=' Submit ',
>         )
>
> _style as shown above is not accepted ...
>
> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to