Copy Code code as follows:
<table id = "PrintA" width= "100%" border= "1" cellspacing= "0" cellpadding= "0" bgcolor = "#61FF13" >
<tr style= "Text-align:center;" >
<TD> Cell a</td>
<TD> Cell a</td>
<TD> Cell a</td>
<TD> Cell a</td>
</TR>
<TR>
<TD colspan=4 style= "Text-align:center;" ><font color= "BLUE" face= "Verdana" > Cell merge Row a</font></td>
</TR>
</TABLE>
<table id = "PRINTB" width= "100%" border= "1" cellspacing= "0" cellpadding= "0" >
<tr style= "Text-align:center;" >
<TD> Cell b</td>
<TD> Cell b</td>
<TD> Cell b</td>
<TD> Cell b</td>
</TR>
<TR>
<TD colspan=4 style= "Text-align:center;" > Cell Merge Row b</td>
</TR>
</TABLE>
<br/>
<input type= "button" onclick= Javascript:allareaword (); "value=" Export page Specify area content to Word >
<input type= "button" onclick= javascript:allareaexcel (); "value=" Export page specify area content to Excel >
<input type= "button" onclick= javascript:cellareaexcel (); "value=" Export table meta content to Excel >
<script language= "JavaScript" >
Specify page area content import Excel
function Allareaexcel ()
{
var oXL = new ActiveXObject ("Excel.Application");
var owb = OXL.Workbooks.Add ();
var osheet = Owb.activesheet;
var sel=document.body.createtextrange ();
Sel.movetoelementtext (PrintA);
Sel.select ();
Sel.execcommand ("Copy");
Osheet.paste ();
oXL.Visible = true;
}
Specify the page area cell content import Excel
function Cellareaexcel ()
{
var oXL = new ActiveXObject ("Excel.Application");
var owb = OXL.Workbooks.Add ();
var osheet = Owb.activesheet;
var lenr = PrintA.rows.length;
for (i=0;i<lenr;i++)
{
var Lenc = printa.rows (i). Cells.length;
for (j=0;j<lenc;j++)
{
Osheet.cells (i+1,j+1). Value = Printa.rows (i). Cells (j). innertext;
}
}
oXL.Visible = true;
}
Specify page area content import Word
function Allareaword ()
{
var OWD = new ActiveXObject ("Word.Application");
var ODC = OWD.Documents.Add ("", 0, 1);
var oRange =odc.range (0,1);
var sel = Document.body.createTextRange ();
Sel.movetoelementtext (PrintA);
Sel.select ();
Sel.execcommand ("Copy");
Orange.paste ();
OWD.Application.Visible = true;
Window.close ();
}
</SCRIPT>