No, you can add an id to the grid (or wrap it in a div with an I'd), and then add the id to the CSS selector.
Anthony On Thursday, September 6, 2012 1:32:42 AM UTC-4, Mandar Vaze wrote: > > Anthony, > > I guess the following will apply to ALL the sqlform.grid in the app, > correct ? > Generally, we have multiple different sqlform.grid across the app, and > each instance may have different columns (and thus possible needing > different column widths) > > I am looking for something like "maxtextlengths" which can be changed "per > sqlform.grid" instance > > -Mandar > > On Wed, Sep 5, 2012 at 8:01 PM, Anthony <abas...@gmail.com > <javascript:>>wrote: > >> If you want to control the column widths and allow the content to wrap if >> necessary, you can do so with CSS (and some JS in IE). Let's say you want >> to set the width of the 5th column. To support IE, in Javascript do: >> >> <script> >> $(function() { >> $('.ie .web2py_table td:nth-child(5)').addClass('td-wrap'); >> }); >> </script> >> >> Then in CSS: >> >> .web2py_table td:nth-child(5), .web2py_table td.td-wrap { >> min-width: 15em; max-width: 20em; white-space: normal !important; >> } >> >> Anthony >> >> On Wednesday, September 5, 2012 10:06:41 AM UTC-4, Mandar Vaze wrote: >>> >>> Using maxtextlengths optional parameter partially helps. >>> http://web2py.com/books/**default/chapter/29/07?search=**maxtextlengths<http://web2py.com/books/default/chapter/29/07?search=maxtextlengths> >>> >>> I say partially because this param controls how many characters are >>> displayed in the column (Only those many characters are sent by the server) >>> If one has too many wide columns, result could be ugly, especially >>> buttons in last column are now shown vertically - depending on screen size >>> etc. >>> >>> I wish there was way to control the column width via web2py >>> >>> -Mandar >>> >>> On Tuesday, September 4, 2012 12:35:55 AM UTC+5:30, Ovidio Marinho wrote: >>>> >>>> how to limit the size of columns in sqlform.grid >>>> 25 >>>> 40 >>>> >>>> 15 >>>> 1 col lenght 25 ======================== >>>> ==============================**========================= >>>> ================= >>>> 2 col lenght 40 >>>> 3 col lenght 15 >>>> etc... >>>> >>>> >>>> >>>> >>>> >>>> Ovidio Marinho Falcao Neto >>>> Web Developer >>>> ovid...@gmail.com >>>> ovidio...@itjp.net.br >>>> ITJP - itjp.net.br >>>> 83 8826 9088 - Oi >>>> 83 9334 0266 - Claro >>>> Brasil >>>> >>>> >>>> -- >> >> >> >> > > --