Here what I found!!

for th in table.elements('th'): th.attributes['_style']='white-space:nowrap;
'

I thought I could achieve it with width parameter falsely!

Thanks for your hand Bruno.

Richard

On Mon, Dec 13, 2010 at 4:10 PM, Richard Vézina <[email protected]
> wrote:

> Thank you!
>
> It works, but my table cells have the same width...
>
> Is SQLTABLE fix the column width base on th width...
>
> I try to give width to TH and TD no success...
>
> I read that TD width is deprecated and should be style: width=200px;
> http://www.w3schools.com/tags/att_td_width.asp
>
> Use CSS instead.
>
> CSS syntax: <td style="width:100px">
>
>
> Try it too no success...
>
>
> I am wondering if we can pass col attribute since there is non helpers for
> it and SQLTABLE generated table not include col tag...
>
>
> Richard
>
>
> On Mon, Dec 13, 2010 at 3:20 PM, Bruno Rocha <[email protected]>wrote:
>
>> Could be another way, but in controller or view you can do:
>>
>>
>> >>> table = SQLTABLE(db(db.category.id>0).select())
>> >>> for td in table.elements('td'): td.attributes['_width']='200px'
>>
>> >>> print table
>> <table><thead><tr><th>category.id</th><th>category.name</th><th>category.created_on</th><th>category.created_by</th><th>category.updated_on</th><th>category.updated_by</th></tr></thead><tbody><tr
>> class="even"><td width="200px">1</td><td width="200px">Sistema Web</td><td
>> width="200px">2010-12-07 04:31:32</td><td width="200px">None</td><td
>> width="200px">2010-12-07 04:31:32</td><td width="200px">None</td></tr><tr
>> class="odd"><td width="200px">2</td><td width="200px">Teste</td><td
>> width="200px">2010-12-11 19:13:26</td><td width="200px">None</td><td
>> width="200px">2010-12-11 19:13:26</td><td
>> width="200px">None</td></tr></tbody></table>
>>
>>
>>
>>
>> 2010/12/13 Richard Vézina <[email protected]>
>>
>> Hello,
>>>
>>> Is it possible to set td width with SQLTABLE? and if yes how?
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>
>>
>>
>> --
>>
>> Bruno Rocha
>> http://about.me/rochacbruno/bio
>>
>
>

Reply via email to