javascript Html µ¼³öΪword excel
<HTML>
<HEAD>
<title>WEBÒ³Ãæµ¼³öΪEXCELÎĵµµÄ·½·¨
</title>
</HEAD>
<body>
<BR>
<table id = "PrintA" width="100%" border="1" cellspacing="0" cellpadding="0" bgcolor = "#61FF13">
<TR style="text-align : center;" mce_style="text-align : center;">
<TD>µ¥Ôª¸ñA</TD>
<TD>µ¥Ôª¸ñA</TD>
<TD>µ¥Ôª¸ñA</TD>
<TD>µ¥Ôª¸ñA</TD>
</TR>
<TR>
<TD colSpan=4 style="text-align : center;" mce_style="text-align : center;"><font color="BLUE" face="Verdana">µ¥Ôª¸ñºÏ²¢ÐÐA</FONT></TD>
</TR>
</TABLE>
<BR>
<table id = "PrintB" width="100%" border="1" cellspacing="0" cellpadding="0">
<TR style="text-align : center;" mce_style="text-align : center;">
<TD>µ¥Ôª¸ñB</TD>
<TD>µ¥Ôª¸ñB</TD>
<TD>µ¥Ôª¸ñB</TD>
<TD>µ¥Ôª¸ñB</TD>
</TR>
<TR>
<TD colSpan=4 style="text-align : center;" mce_style="text-align : center;">µ¥Ôª¸ñºÏ²¢ÐÐB</TD>
</TR>
</TABLE>
<br><br><br>
<input type="button" onclick="javascript:AllAreaWord();" value="µ¼³öÒ³ÃæÖ¸¶¨ÇøÓòÄÚÈݵ½Word">
<input type="button" onclick="javascript:AllAreaExcel();" value="µ¼³öÒ³ÃæÖ¸¶¨ÇøÓòÄÚÈݵ½Excel">
<input type="button" onclick="javascript:CellAreaExcel();" value="µ¼³ö±íµ¥µ¥Ôª¸ñÄÚÈݵ½Excel">
<SCRIPT LANGUAGE="javascript">
//Ö¸¶¨Ò³ÃæÇøÓòÄÚÈݵ¼Èë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;
}
//Ö¸¶¨Ò³ÃæÇøÓò“µ¥Ôª¸ñ”ÄÚÈݵ¼ÈëExcel
function CellAreaExcel()
{
var oXL = new ActiveXObject("Excel.Application");
var oWB = oXL.Work
Ïà¹ØÎĵµ£º
ÀûÓÃjsÀ´¶¯Ì¬´´½¨±í¸ñÓÐÁ½ÖÖ¸ñʽ£¬appendChild()ºÍinsertRow¡¢insertCell()¡£Á½ÖÖ·½Ê½Æäʵ²î²»¶à£¬µ«µÚÒ»ÖÖÓпÉÄÜÔÚIEÉÏÓÐÎÊÌ⣬ËùÒÔÍƼö´ó¼ÒʹÓõڶþÖÖÁË£¬Ö±½Ó˵°É¡£
1¡¢inserRow()ºÍinsertCell()º¯Êý
insertRow()º¯Êý¿ÉÒÔ´ø²ÎÊý£¬ÐÎʽÈçÏ£º
insertRow(index)£ºindex´Ó0¿ªÊ¼
¡¡¡¡Õâ¸öº¯Êý½«ÐÂÐÐÌí¼Óµ½indexµÄÄÇÒ»ÐÐÇ ......
×¢Ò⣺readOnlyÖеÄOÒª´óд
//Ò³Ãæ³õʼ»¯Â¼È룬ÅжÏÖ¸±ê˵Ã÷ÊÇ·ñΪ¹¤×ÊÐÔÖ§³ö¡£
function init() {
var mark = "<%=mark%>";
//Èç¹ûÖ¸±ê˵Ã÷Ϊ“¹¤×ÊÐÔÖ§³ö”£¬Ôò¹¤×ÊÖ§³öÄÇÒ»Ïî±äΪֻ¶Á£¬ÇÒֵΪ“Ö¸±ê¿ÉÓýð¶î”£»ÆäËû¼Èë¿ò¶¼²»¿É¼Èë¡£
......
±¾ÈËÒ»°ãÓÃeditplusдһЩСµÄ²âÊÔ´úÂë»òÕßÀ´Ñо¿Ñ§Ï°±ðÈ˵ĴúÂ룬µ«¾³£»áÓöµ½ÕâЩÎÊÌ⣺ÏÂÔعýÀ´µÄHTML/CSS´úÂë»ìÂÒ£¬JS´úÂ뱻ѹËõ£¬»òÕßÊÇÎÒÃÇÏë°ÑÎÒÃǵĴúÂë×öÒ»ÏÂѹËõ»ìÏýÒÔ¹©·¢²¼Ê±Ê¹Óᣵ±È»£¬¶ÔÓÚ´úÂëµÄ¸ñʽ»¯ºÍ´úÂëѹËõµÈ£¬ÎÒÃǶ¼¿ÉÒÔʹÓÃרÓеŤ¾ß£¬»òÕßʹÓÃһЩÔÚÏߵŤ×÷À´×ö£¬¼ÈÈ»E ......
aspx Éú³ÉHTML ¾²Ì¬Ò³ £ºhttp://www.cnblogs.com/ejiyuan/archive/2007/11/09/954325.html
cs Ò³£º
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
u ......
Although the days of long and tedious code branches to target specific browsers in JavaScript are over, once in a while it's still necessary to do some simple code branching and object detection to ensure that a certain piece of code is working properly on a user's machine.
In this article, I ......