home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / spyce / *.* / spylambda.spy < prev    next >
Encoding:
Text File  |  2004-05-18  |  721 b   |  34 lines

  1. [[
  2.   # table template
  3.   table = [[spy! title, data: 
  4.     <table>
  5.       <tr>
  6.         [[for cell in title: {]]
  7.           <td><b>[[=cell]]</b></td>
  8.         [[}]]
  9.       </tr>
  10.       [[for row in data: {]]
  11.         <tr>
  12.           [[for cell in row: {]]
  13.             <td>[[=cell]]</td>
  14.           [[}]]
  15.         </tr>
  16.       [[}]]
  17.     </table> 
  18.   ]]
  19.  
  20.   # table information
  21.   title = ['Country', 'Size', 'Population', 'GDP per capita']
  22.   data = [
  23.     [ 'USA', '9,158,960', '280,562,489', '$36,300' ],
  24.     [ 'Canada', '9,220,970', '31,902,268', '$27,700' ],
  25.     [ 'Mexico', '1,923,040', '103,400,165', '$9,000' ],
  26.   ]
  27. ]]
  28.  
  29. [[-- emit web page --]]
  30. <html><body>
  31.   [[ table(title, data) ]]
  32. </body></html>
  33.  
  34.