On Jul 3, 2009, at 1:48 PM, mdipierro wrote:

>
> with that looks like this: http://www.web2py.com/examples/spreadsheet

I'm new to the web2py game, so pardon me if this is a settled question.

I'm wondering whether you wouldn't want to try to do stuff like this  
in an (x)html-compliant manner. Neither an empty <form> nor an empty  
<style> is permitted, for example.

I realize that web2py isn't entirely compliant anyway, but might we  
not work in the direction of compliance?

>
> On Jul 3, 3:40 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>> 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>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to