Incullymili
New Member
i have tried several methods the Datatable method with a button click and also this java script:\[code\]<script type="text/javascript">var tableToExcel = (function () { var uri = 'data:application/vnd.ms-excel;base64,', template = '<html xmlns="urn:schemas-microsoft-comfficeffice" xmlns:x="urn:schemas-microsoft-comffice:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><xisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>', base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) } return function (table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML } window.location.href = http://stackoverflow.com/questions/14055535/uri + base64(format(template, ctx)) }})()</script> \[/code\]with this button:\[code\]<input type="button" onclick="tableToExcel('myTable', 'W3C Example Table')" value="http://stackoverflow.com/questions/14055535/Export to Excel">\[/code\]Is it Possible save also the formatted css Table? I only formatted the tables at tr for example like this\[code\]<tr class="wassat"><td><a>280 Zzzap</a></td><td><a>Bally Astrocade</a></td><td><a>arc 4/10</a></td><td><a>badan</a></td><td><a>3/5</a></td><td><a>Rc</a></td><td><a>Arc</a></td><td><a>1978</a></td><td><a>Didam</a></td><td><a></a></td></tr>\[/code\]the css code is like this\[code\]tr.wassat { background-color:#DF7401; }\[/code\]I hope this is not a double post couldn`t find it in search. Thx in Advance