【发布时间】:2012-07-31 13:19:23
【问题描述】:
在我的应用程序中,我使用 SQLTABLE 来显示内容。我必须为此表数据指定一些 css 样式。 请告诉我如何将样式设置为 SQLTABLE 数据。
示例:
#percengate datatype: decimal(5,2)
rows = db().select(db.t_tax.id,db.t_tax.percentage)
db.t_tax.percentage.represent = lambda r,v: str(v.percentage)+'%'
columns = ['t_tax.id','t_tax.percentage']
headers = {
't_tax.id':{'label':T('id'),
'class':'', #class name of the header
'width':'', #width in pixels or %
'truncate': 50, #truncate the content to...
'selected': False #agregate class selected to this column
},
't_tax.percentage':{'label':T('Tax'),
'class':'', #class name of the header
'width':'', #width in pixels or %
'truncate': 50, #truncate the content to...
'selected': False #agregate class selected to this column
}
}
table = SQLTABLE(rows,columns=columns,headers=headers,_width='100%',_class='datatable')
在此表中,我想右对齐百分比列数据。现在它显示为左对齐的普通字符串(10.00%,20.00%)。我找不到任何选项来指定仅与 percetage 列对齐。
我将非常感谢任何 cmets。
【问题讨论】:
-
您能否更具体地了解您需要设置的 CSS 样式?
标签: web2py