sheet['cell_name'].size=4 # is the default. You will have to change it
for every cell or change it in sheet.py
Here is a much better index html that makes it look more like Excel:
{{extend 'layout.html'}}
<style>
/*
the code in this page is here just to provide an example
none of the css markup and script is required for the sheet to
function
it is required to make it look good and can be further customized
*/
.sheet td {
text-align: left;
vertical-align: top;
padding: 0 0 0 0;
border: 0 0 0 0;
spacing: 0 0 0 0;
}
.sheet input {
border: 0;
}
td.colhead, td.rowhead {
background-color: #bbbbbb;
padding-left: 5px;
padding-right: 5px;
}
td.rowhead {
width: 30px;
text-align: right;
}
</style>
<form>
<div class="sheet">
<table>
<tr>
<td class="colhead" id="selected_cell"></td>
<td colspan="{{=sheet.cols}}">
<input readonly id="formula" size="{{=6*sheet.cols}}px"/>
</td>
</tr>
<tr>
<td class="colhead"></td>
{{for c in xrange(sheet.cols):}}
<td class="colhead">c{{=c}}</td>
{{pass}}
</tr>
{{for r in xrange(sheet.rows):}}
<tr>
<td class="rowhead">r{{=r}}</td>
{{for c in xrange(sheet.cols):}}
<td class="cells">
{{=XML(sheet.nodes['r%sc%s'%(r,c)].xml())}}
</td>
{{pass}}
</tr>
{{pass}}
</table>
</div>
</form>
<script>
function update_formula(t) {
if(t) {
jQuery('#selected_cell').html(jQuery(t).attr('id'));
jQuery('#formula').val(jQuery(t).val());
} else {
jQuery('#selected_cell').html('');
jQuery('#formula').val('');
}
};
jQuery('.cells input').focus(function(){update_formula(this);});
jQuery('.cells input').keyup(function(){update_formula(this);});
jQuery('.cells input').blur(function(){update_formula(null);});
</script>
On Jul 3, 2:47 pm, Hans <[email protected]>
wrote:
> great stuff massimo!!!
>
> how can the size of the cells be adjusted? Basically I want wider
> cells.
>
> Thanks,
> Hans
>
> On Jul 3, 4:16 am, mdipierro <[email protected]> wrote:
>
> > Do you need to embed an ajax spreadsheet in you app. Now you have it:
>
> >http://www.vimeo.com/5432441http://www.web2py.com/appliances/default/...
>
> > Please let know about bugs
>
> > Massimo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---