If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    apardue  14 years ago
    Hi - I have been using the grid for a while throughout a site I am building, and everything is working fine. However, when I tried to style it with CSS I was having no luck. In an attempt to get the simplest set up to identify what I'm doing wrong, I started a fresh web2py app called 'grid' and imported the webgrid module. I then and put in the model: db.define_table('mytable', Field('myname','string'), Field('mydob','date')) webgrid = local_import('webgrid') And in the default controller: def index(): grid = webgrid.WebGrid(crud) grid.datasource = db(db.mytable.id>0) grid.pagesize = 10 grid.footer = lambda fields : TFOOT(TD("This is my footer" , _colspan=len(grid.action_links)+len(fields), _style="text-align:center;"), _class=grid.css_prefix + '-webgrid footer') return dict(grid=grid()) And in the base.css: .grid-webgrid footer { background-color: blue; font-family: Arial; } The grid works fine, but the css isn't being applied. Can anyone help point out what I'm doing wrong? I'm pretty new to css and can't for the life figure out where I've messed up. Great slice - thanks in advance.

Commented on:

This is a module that lets you build a table on the server that supports paging, sorting, editing and totals easily. It requires no javascript or sessions to work.

Hosting graciously provided by:
Python Anywhere