Guest

Untitled

By: a guest on Jul 17th, 2011  |  syntax: HTML  |  size: 0.68 KB  |  hits: 58  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. <html><head>
  2. <title>hello</title>
  3. <script src="jquery-1.5.2.min.js"></script>
  4. <script src="htmltable.js"></script>
  5. <script>
  6. function dynamicTable(URL, id){
  7.     url = URL + '?id=' + id
  8.    
  9.     $.getJSON(url, function(data) {
  10.         captions = {'code':'Code','descr':{'content':'Description','attr': 'style="width: 800px"'}}
  11.         html_table = build_table(data, captions);
  12.         $('#anyDivId').html(html_table);
  13.     });
  14. }
  15. </script>
  16. <style>
  17. .tableclass {padding: 10px; min-width: 80px}
  18. .tableclass thead tr {background-color: #ccccff}
  19. </style>
  20. </head>
  21. <body>
  22.  
  23. <div id="anyDivId">&nbsp;</div>
  24. <a href="javascript:dynamicTable('autos.json',1)">Click me</a>
  25. </body>
  26. </html>