*Premise*
bootstrap tables with striped rows have the following classes:

 - table
 - table-striped

reference: http://getbootstrap.com/css/#tables

*Padding*
bootstrap .table class assigns a padding of 8px to th and td elements while 
in stupid the th and td padding is 5px
So in order to assign a different value we should set

.table.myeheaders th,
.table.myeheaders td {
     /* top | right | bottom | left */
    padding: 0 0 0 0;   /* change values as you like  */
}


*Table width*
bootstrap .table has a width of 100%
So in order to give a natural width to the table.table we should set

.table.myeheaders {
    width:auto;
}


Our code becomes:

<style>
.table.myeheaders {width:auto;}
.table.myeheaders th,
.table.myeheaders td {
     /* top | right | bottom | left */
    padding: 0 0 0 0;   /* change values as you like  */
}
.table-striped .w2p_odd.odd {background-color:#ddffcc;}
</style>


{{extend 'layout.html'}}
<h1>This is the default/sorted.html template</h1>
{{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
    columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], _class="table 
table-striped myeheaders")}}



Il giorno giovedì 8 dicembre 2016 08:03:53 UTC+1, Dave S ha scritto:
>
>
>
> On Wednesday, December 7, 2016 at 3:02:10 PM UTC-8, Paolo Caruccio wrote:
>>
>> Below code should work with bootstrap and stupid.css
>>
>> <style>
>> .table.myeheaders th {padding-right:2em;}
>> .table-striped .w2p_odd.odd {background-color:#ddffcc;}
>> </style>
>>
>> {{extend 'layout.html'}}
>> <h1>This is the default/sorted.html template</h1>
>> {{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
>> 'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
>>     columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], _class="table 
>> table-striped myeheaders")}}
>>
>>
>> Some readings:
>>
>> https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
>> https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors
>>
>>
>>
> The table class does interesting things, but not what I want.   That gave 
> 8px padding on all 4 sides, and the columns divided up the full width.   
> Better than the default styling, but I prefer a more compact look.
>
> What I have now is
>
> <style>
> .myeheaders th {padding-right:2em;}
> .table-striped .w2p_odd.odd {background-color:#ddffcc;}
> </style>
>
> {{extend 'layout.html'}}
> <h1>This is the default/sorted.html template</h1>
> {{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
> 'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
>     columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], 
> _class="table-striped myeheaders")}}
>
>
>  Interesting that that looks like your first post ... I must have missed 
> something on the earlier try.
>
> Thanks for your help.
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to