este es mi codigo
Código Javascript:
Ver original
<script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script language="javascript"> <script language="javascript"> $(document).ready(function() { $("#btnExport").click(function(e) { window.open('data:application/vnd.ms-excel,' + $('#div-1a').html() + $('#div-1b').html()); e.preventDefault(); }); }); </script> </script>
Código CSS:
Ver original
<style type="text/css"> .botonExcel{cursor:pointer;} #contenedor{ width:800px; margin-right: auto; margin-left: 50px; *zoom: 1; display: table; line-height: 0; content: ""; clear: both; } #div-1a { float:left; width:auto; } #div-1b { float:left; width:auto; } </style>
Código HTML:
Ver original
<body> <br/> <div id="contenedor"> <div id="div-1a"> <div id="dvData" class="dvData"> <table> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> </table> </div> </div> <div id="div-1b"> <div id="dvData" class="dvData"> <table> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> </table> </div> </div> <input type="button" id="btnExport" value=" Export Table data into Excel " /> </p> </body>