日期:2014-05-16 浏览次数:20832 次
<style type="text/css" title="currentStyle"> @import "js/datatables/css/demo_page.css"; @import "js/datatables/css/demo_table.css"; </style> <script type="text/javascript" language="javascript" src="js/datatables/js/jquery.js"></script> <script type="text/javascript" language="javascript" src="js/datatables/js/jquery.dataTables.js"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#example').dataTable( { "sPaginationType": "full_numbers" } ); } ); </script>
String test; test="<table cellpadding='0' cellspacing='0' border='0' class='display' id='example'>"+ "<thead><tr><th>aa</th><th>bb</th><th>cc</th><th>dd</th></tr></thead>"+ "<tbody>"+ "<tr><td>a</td><td>b</td><td>c</td><td>d</td></tr>"+ "<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr>"+ "</tbody></table>"; try { response.getWriter().write(test); } catch (IOException e) { e.printStackTrace(); }
var reportrs = req_report.responseText; document.getElementById('dynamic').innerHTML=reportrs;
<div id="dynamic"></div>