<td id='tdId'>aaa</td>clipboardData.setData('Text',document.all.tdId.innerText)

解决方案 »

  1.   

    clipboardData.setData('Text',YourTableID.rows(第几行).cells(第几列).innerText)
      

  2.   

    <INPUT TYPE="button" value="复制测试表格" onclick="CopyTable()">
    <INPUT TYPE="button" value="将剪切板内容输出到编辑器中" onclick="PastClipboardData()"><BR>
    测试
    <span onclick="CopyTable()"><img name="" src="http://images.sohu.com/cs/sms/alumni3/images/bluenav_1.gif" width="32" height="32" alt=""></span>
    <iframe id="editor" src="about:blank"></iframe>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function CopyTable()
    {
     CopyHtmlElement(oTable)
    }
     
    function CopyHtmlElement(obj)
    {
     editor.document.designMode = 'On'; // 将iframe变成可编辑模式,即HTML编辑器
     editor.document.write("<body></body>");  // 初始化编辑器
     editor.document.body.innerHTML = obj.outerHTML;
     editor.document.body.createTextRange().select(); // 选中编辑器内所有内容
     editor.document.execCommand("copy","",null); // 复制
    }
    function PastClipboardData()
    {
     editor.focus();
     editor.document.execCommand("paste","",null); // 粘贴
    }
    //-->
    </SCRIPT>