
Untitled
By: a guest on Jul 17th, 2011 | syntax:
HTML | size: 0.68 KB | hits: 58 | expires: Never
<html><head>
<title>hello</title>
<script src="jquery-1.5.2.min.js"></script>
<script src="htmltable.js"></script>
<script>
function dynamicTable(URL, id){
url = URL + '?id=' + id
$.getJSON(url, function(data) {
captions = {'code':'Code','descr':{'content':'Description','attr': 'style="width: 800px"'}}
html_table = build_table(data, captions);
$('#anyDivId').html(html_table);
});
}
</script>
<style>
.tableclass {padding: 10px; min-width: 80px}
.tableclass thead tr {background-color: #ccccff}
</style>
</head>
<body>
<div id="anyDivId"> </div>
<a href="javascript:dynamicTable('autos.json',1)">Click me</a>
</body>
</html>