to control the css of the first th in a tr, now i have to use jquery
to customize it .
when a site contains lots of sqlforms, i have to do it again and
again. if the tag is th, it's much more convenient.

in actual fact, to forms wrapped by table in internet, the first
column of them is a little difference from other columns, while web2py
doesn't provide  a easy way to customize it , as we can see, a tr is
generated by TR('','',''), so we have to write js to css it .

'th' is expedient measure to customize it partially, but i don't think
it is a good solution.  I would  be very appreciated if every column
of a form generated by sqlform can be customized .

i have a suggestion that when define a table,  field should provide a
parameter ( I name it "styles") to control its css, for example:
db.define_table('test_table',
         Field('column', label='label', styles=["specified css for
column first", "specified css for column second", "specified css for
column third"]),
)
then , the tr is render as <tr><td class='specified css for column
first'></td><td class='specified css for column second'></td><td></
td></tr>.

of course, the parameter "styles" can also be provided in sqlform , it
like this:
form = sqlform(db.table,
styles={'field_name_1': ["specified css for column first", "specified
css for column second", "specified css for column third"], \
'field_name_2': ["specified css for column first", "specified css for
column second", "specified css for column third"], \
'field_name_3': ["specified css for column first", "specified css for
column second", "specified css for column third"], \
'field_name_4': ["specified css for column first", "specified css for
column second", "specified css for column third"],}
)

if no "styles" provided, everything keeps the same as now. so it can
keep compatible.

thanks great web2py !
On Oct 15, 12:11 am, DenesL <denes1...@yahoo.ca> wrote:
> hywang,
> can you expand on the convenience this change brings?.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to