excel|javascript| data
Online collection of code
<input type= "button" Name= "Out_excel" value= "Export to Excel" class= "Notprint" >
Export to Excel code
<script language= "JavaScript" >
<!--
function Automateexcel ()
{
Start Excel and get Application object.
var oXL = new ActiveXObject ("Excel.Application");
Get a new workbook.
var owb = OXL.Workbooks.Add ();
var osheet = Owb.activesheet;
var table = Document.all.data;
var hang = table.rows.length;
var lie = table.rows (0). Cells.length;
ADD table headers going cell by cell.
for (i=0;i{
for (j=0;j<lie;j++)
{
Osheet.cells (i+1,j+1). Font.Bold = True
Osheet.cells (i+1,j+1). Font.Size = 50
Osheet.cells (i+1,j+1). Alignment = 2
Osheet.cells (i+1,j+1). Value = Table.rows (i). Cells (j). innertext;
}
}
oXL.Visible = true;
Oxl.usercontrol = true;
}
-->
</SCRIPT>
<table border= "1" width= "100%" id= "Data" >
<tr>
<td> name </td>
<TD colspan= "2" > Age </td>
<td> Birth date </td>
</tr>
<tr>
<td>6</td>
<td>25</td>
<TD colspan= "2" >8</td>
</tr>
<tr>
<TD height= ">1</td>"
<TD height= ">2</td>"
<TD colspan= "2" height= ">4</td>"
</tr>
</table>