高分求给Table加属性,怎么加啊?up有分小弟现在要做个网站模板,现在选择了用FCKeditor做编辑器,FCKeditor里面有一个加表的,然后我这里因有特殊要求,所以要给Table 加几个属性,怎么加呢.例如加左边距,加离顶部的距离,加表的类型(因为我要跟据这个特殊类型的标识去创建点东东)
还有就是在保存的时候,我怎么样才可以把这类标识的表取出来,谢谢.

解决方案 »

  1.   

    FCKEditor没用过!没办法帮你了!
      

  2.   

    不一定要知道FCKEditor啊,其实就是在怎么给表扩展属性啊.
      

  3.   

    to:imwjb(回帖前先看看楼主有没有结贴的习惯……) 
    好的,谢谢
      

  4.   

    是用javaScript啊,但是不知道怎么搞,哈哈.
      

  5.   

    在客户端
    这是JS的问题吧
    用js扩展几个属性就可以了
      

  6.   

    to:lovefootball
    您知道FCKeditor的表扩展属性的在哪个地方吗?
      

  7.   

    FCKeditor  呵呵  不知道是什么玩意~惭愧~!!!
      

  8.   

    http://my.jcwcn.com/?23883/action_viewspace_itemid_8211
      

  9.   

    FCKeditor  就是那个世界上最好的编辑器啊.而且还是免费的,开源的啊.是个好东东.
      

  10.   

    边距可能加style可以,但类型不好加啊.
    再说我也不是很想用style,最好是扩展属性,硬是不行的话,再考虑用style
      

  11.   

    up给几分啊?
    多up几下吧
    up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up
      

  12.   

    可以自己写FCKEditor的js扩展,不要它原来的插入表格,原理是一样的,新建一个html文件insertTable.htm,代码如下:
    <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>插入表格</title>
    <style>body {
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 0px;
    background: #ffffff; 
    width: 100%;
    overflow:hidden;
    border: 0;
    }body,tr,td {
    color: #000000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10pt;
    }
    </style>
    <script language="javascript">
    function returnTable() 
    {
    var arr = new Array(); arr["width"] = document.getElementById('Width').value;  
    arr["height"] = document.getElementById('Height').value;
    arr["cellpadding"] = document.getElementById('Cellpadding').value;  
    arr["cellspacing"] = document.getElementById('Cellspacing').value;
    arr["border"] = document.getElementById('Border').value;   arr["cols"] = document.getElementById('Columns').value;
    arr["rows"] = document.getElementById('Rows').value;
    arr["valigncells"] = document.getElementById('VAlignCells')[document.getElementById('VAlignCells').selectedIndex].value;
    arr["haligncells"] = document.getElementById('HAlignCells')[document.getElementById('HAlignCells').selectedIndex].value;
    arr["percentcols"] = document.getElementById('PercentCols').checked;

    arr["cellleft"]=document.getElementById('CellLeft');
    arr["cellright"]=document.getElementById('CellRight');
     
    window.returnValue = arr;
    window.close();
    }
    </script>
    </HEAD>
    <body>
    <table width=100% cellpadding=1 cellspacing=3 border=0>
    <tr><td valign=top>
    <fieldset ><legend>表格</legend>
    <table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td>宽度</td>
    <td><input type=text id="Width" name="Width" value=100 style="width:50px;"></td>
    </tr><tr>
    <td>高度</td>
    <td><input type=text id="Height" name="Height" value=100 style="width:50px;"></td>
    </tr><tr>
    <td>单元格边距</td>
    <td><input type=text id="Cellpadding" name="Cellpadding" style="width:50px;" value=0></td>
    </tr><tr>
    <td>单元格间距</td>
    <td><input type=text id="Cellspacing" name="Cellspacing" style="width:50px;" value=0></td>
    </tr><tr>
    <td>边框粗细</td>
    <td><input type=text id="Border" name="Border" style="width:50px;" value=1></td>
    </tr>
    </table>
    </fieldset>
    </td>
    <td>&nbsp;&nbsp;</td><td valign=top>
    <fieldset ><legend>单元格</legend>
    <table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td>列数</td>
    <td><input type=text id="Columns" name="Columns" style="width:80px;" value=2></td>
    </tr><tr>
    <td>行数</td>
    <td><input type=text id="Rows" name="Rows" style="width:80px;" value=2></td>
    </tr><tr>
    <td>垂直对齐方式</td>
    <td><select id="VAlignCells" name="VAlignCells" style="width:80px;">
    <option>默认</option>
    <option value="top">顶端对齐</option>
    <option value="center">相对垂直居中</option>
    <option value="bottom">相对底边对齐</option>
    </select>
    </td>
    </tr><tr>
    <td>水平对齐方式</td>
    <td><select id="HAlignCells" name="HAlignCells" style="width:80px;">
    <option>默认</option>
    <option value="left">左对齐</option>
    <option value="center">居中</option>
    <option value="right">右对齐</option>
    </select>
    </td>
    </tr><tr>
    <td>平均分配各列</td>
    <td><input type="checkbox" id="PercentCols" name="PercentCols" value="1"></td>
    </tr>
    <tr>
      <td>左边距</td>
      <td><input type="text" id="CellLeft" name="CellLeft" /></td>
    </tr>
       <tr>
      <td>右边距</td>
      <td><input type="text" id="CellRight" name="CellRight" /></td>
    </tr>
    </table>
    </fieldset>
    </td></tr>
    <tr><td colspan=3 align=center>
    <input type="button" onclick="returnTable();return false;" value="插入表格">
    </td></tr>
    </table>
    </body>
    </html>
    如下方式调用
     //插入表格
      function insertTable()
      {debugger;
        var tabSource=showModalDialog('insertTable.htm','','dialogWidth:400px;dialogHeight:400px;status:0;help:0');
        if(undefined==tabSource)
        {
         return false;
        }
        var tab=document.createElement('table');    
        var tab_body=document.createElement('tbody');
        var tdObjWidth;
        if(tabSource.percentcols==true)
         {
           tdObjWidth=(100*1.0/parseInt(tabSource.cols))+"%";
         }
        tab.width=tabSource.width;
        tab.height=tabSource.height;
        tab.cellpadding=tabSource.cellpadding;
        tab.cellspacing=tabSource.cellspacing;
        tab.border=tabSource.border;    
        tab.style.align=tabSource.haligncells;
        tab.style.valign=tabSource.valigncells;
        //在此进行左边距和右边距的设置,代码如上几行
        for(var i=0;i<parseInt(tabSource.rows);i++)
         {
           var tr_obj=document.createElement('tr');
           for(var j=0;j<parseInt(tabSource.cols);j++)
            {
              var td_obj=document.createElement('td');
              if(tabSource.percentcols==true)
              {
               td_obj.style.width=tdObjWidth;           
              }
              td_obj.innerHTML="&nbsp;";
              tr_obj.appendChild(td_obj);
            }
           tab_body.appendChild(tr_obj);
         }
        tab.appendChild(tab_body);
        $('Editor').innerHTML+=tab.outerHTML;//将生成的代码加到FCKEditor中
      }
      

  13.   

    谢谢lizhizhe2000(武安侯),花这么多时间给我提供了这么多代码,不过可能我们还是会在那个表上直接改,如果自己做一个的话,花的时间可能会太多了.而且做出的风格之类的,可能都不同.对了,再问一下,您知道在FCKEditor中,如果要扩展这个属性,在哪里扩展?
      

  14.   

    FCKEdtior中有一个示例,是关于js扩展的,也可看这个链接
    http://www.cnblogs.com/matrix/archive/2007/04/16/714726.aspx
    你的功能还是比较容易实现的!
      

  15.   

    在fckeditorcode_ie.js中有关fctTable的有以下:
    var FCKTableHandler=new Object();FCKTableHandler.InsertRow=function(){var A=FCKSelection.MoveToAncestorNode("TR");if (!A) return;var B=A.cloneNode(true);A.parentNode.insertBefore(B,A);FCKTableHandler.ClearRow(A);};FCKTableHandler.DeleteRows=function(A){if (!A) A=FCKSelection.MoveToAncestorNode("TR");if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');if (B.rows.length==1){FCKTableHandler.DeleteTable(B);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){var A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode("TABLE");};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(){var A=FCKSelection.MoveToAncestorNode("TD");if (!A) A=FCKSelection.MoveToAncestorNode("TH");if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex+1;for (var i=0;i<B.rows.length;i++){var D=B.rows[i];if (D.cells.length<C) continue;A=D.cells[C-1].cloneNode(false);if (FCKBrowserInfo.IsGecko) A.innerHTML=GECKO_BOGUS;var E=D.cells[C];if (E) D.insertBefore(A,E);else D.appendChild(A);}};FCKTableHandler.DeleteColumns=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex;for (var i=B.rows.length-1;i>=0;i--){var D=B.rows[i];if (C==0&&D.cells.length==1){FCKTableHandler.DeleteRows(D);continue;};if (D.cells[C]) D.removeChild(D.cells[C]);}};FCKTableHandler.InsertCell=function(A){var B=A?A:FCKSelection.MoveToAncestorNode("TD");if (!B) return;var C=FCK.EditorDocument.createElement("TD");if (FCKBrowserInfo.IsGecko) C.innerHTML=GECKO_BOGUS;if (B.cellIndex==B.parentNode.cells.length-1){B.parentNode.appendChild(C);}else{B.parentNode.insertBefore(C,B.nextSibling);};return C;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler.MergeCells=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length<2) return;if (A[0].parentNode!=A[A.length-1].parentNode) return;var B=isNaN(A[0].colSpan)?1:A[0].colSpan;var C='';var D=FCK.EditorDocument.createDocumentFragment();for (var i=A.length-1;i>=0;i--){var E=A[i];for (var c=E.childNodes.length-1;c>=0;c--){var F=E.removeChild(E.childNodes[c]);if ((F.hasAttribute&&F.hasAttribute('_moz_editor_bogus_node'))||(F.getAttribute&&F.getAttribute('type',2)=='_moz')) continue;D.insertBefore(F,D.firstChild);};if (i>0){B+=isNaN(E.colSpan)?1:E.colSpan;FCKTableHandler.DeleteCell(E);}};A[0].colSpan=B;if (FCKBrowserInfo.IsGecko&&D.childNodes.length==0) A[0].innerHTML=GECKO_BOGUS;else A[0].appendChild(D);};FCKTableHandler.SplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=this._CreateTableMap(A[0].parentNode.parentNode);var C=FCKTableHandler._GetCellIndexSpan(B,A[0].parentNode.rowIndex,A[0]);var D=this._GetCollumnCells(B,C);for (var i=0;i<D.length;i++){if (D[i]==A[0]){var E=this.InsertCell(A[0]);if (!isNaN(A[0].rowSpan)&&A[0].rowSpan>1) E.rowSpan=A[0].rowSpan;}else{if (isNaN(D[i].colSpan)) D[i].colSpan=2;else D[i].colSpan+=1;}}};FCKTableHandler._GetCellIndexSpan=function(A,B,C){if (A.length<B+1) return null;var D=A[B];for (var c=0;c<D.length;c++){if (D[c]==C) return c;};return null;};FCKTableHandler._GetCollumnCells=function(A,B){var C=new Array();for (var r=0;r<A.length;r++){var D=A[r][B];if (D&&(C.length==0||C[C.length-1]!=D)) C[C.length]=D;};return C;};FCKTableHandler._CreateTableMap=function(A){var B=A.rows;var r=-1;var C=new Array();for (var i=0;i<B.length;i++){r++;if (!C[r]) C[r]=new Array();var c=-1;for (var j=0;j<B[i].cells.length;j++){var D=B[i].cells[j];c++;while (C[r][c]) c++;var E=isNaN(D.colSpan)?1:D.colSpan;var F=isNaN(D.rowSpan)?1:D.rowSpan;for (var G=0;G<F;G++){if (!C[r+G]) C[r+G]=new Array();for (var H=0;H<E;H++){C[r+G][c+H]=B[i].cells[j];}};c+=E-1;}};return C;};FCKTableHandler.ClearRow=function(A){var B=A.cells;for (var i=0;i<B.length;i++){if (FCKBrowserInfo.IsGecko) B[i].innerHTML=GECKO_BOGUS;else B[i].innerHTML='';}};
    var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();switch (this.Name){case 'TableInsertRow':FCKTableHandler.InsertRow();break;case 'TableDeleteRows':FCKTableHandler.DeleteRows();break;case 'TableInsertColumn':FCKTableHandler.InsertColumn();break;case 'TableDeleteColumns':FCKTableHandler.DeleteColumns();break;case 'TableInsertCell':FCKTableHandler.InsertCell();break;case 'TableDeleteCells':FCKTableHandler.DeleteCells();break;case 'TableMergeCells':FCKTableHandler.MergeCells();break;case 'TableSplitCell':FCKTableHandler.SplitCell();break;case 'TableDelete':FCKTableHandler.DeleteTable();break;default:alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;}
      

  16.   


    var FCKCommands=FCK.Commands=new Object();FCKCommands.LoadedCommands=new Object();FCKCommands.RegisterCommand=function(A,B){this.LoadedCommands[A]=B;};FCKCommands.GetCommand=function(A){var B=FCKCommands.LoadedCommands[A];if (B) return B;switch (A){case 'DocProps':B=new FCKDialogCommand('DocProps',FCKLang.DocProps,'dialog/fck_docprops.html',400,390,FCKCommands.GetFullPageState);break;case 'Templates':B=new FCKDialogCommand('Templates',FCKLang.DlgTemplatesTitle,'dialog/fck_template.html',380,450);break;case 'Link':B=new FCKDialogCommand('Link',FCKLang.DlgLnkWindowTitle,'dialog/fck_link.html',400,330,FCK.GetNamedCommandState,'CreateLink');break;case 'Unlink':B=new FCKUnlinkCommand();break;case 'Anchor':B=new FCKDialogCommand('Anchor',FCKLang.DlgAnchorTitle,'dialog/fck_anchor.html',370,170);break;case 'BulletedList':B=new FCKDialogCommand('BulletedList',FCKLang.BulletedListProp,'dialog/fck_listprop.html',370,170);break;case 'NumberedList':B=new FCKDialogCommand('NumberedList',FCKLang.NumberedListProp,'dialog/fck_listprop.html',370,170);break;case 'About':B=new FCKDialogCommand('About',FCKLang.About,'dialog/fck_about.html',400,330);break;case 'Find':B=new FCKDialogCommand('Find',FCKLang.DlgFindTitle,'dialog/fck_find.html',340,170);break;case 'Replace':B=new FCKDialogCommand('Replace',FCKLang.DlgReplaceTitle,'dialog/fck_replace.html',340,200);break;case 'Image':B=new FCKDialogCommand('Image',FCKLang.DlgImgTitle,'dialog/fck_image.html',450,400);break;case 'Flash':B=new FCKDialogCommand('Flash',FCKLang.DlgFlashTitle,'dialog/fck_flash.html',450,400);break;case 'SpecialChar':B=new FCKDialogCommand('SpecialChar',FCKLang.DlgSpecialCharTitle,'dialog/fck_specialchar.html',400,320);break;case 'Smiley':B=new FCKDialogCommand('Smiley',FCKLang.DlgSmileyTitle,'dialog/fck_smiley.html',FCKConfig.SmileyWindowWidth,FCKConfig.SmileyWindowHeight);break;case 'Table':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html',450,250);break;case 'TableProp':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html?Parent',400,250);break;case 'TableCellProp':B=new FCKDialogCommand('TableCell',FCKLang.DlgCellTitle,'dialog/fck_tablecell.html',500,250);break;case 'UniversalKey':B=new FCKDialogCommand('UniversalKey',FCKLang.UniversalKeyboard,'dialog/fck_universalkey.html',415,300);break;case 'Style':B=new FCKStyleCommand();break;case 'FontName':B=new FCKFontNameCommand();break;case 'FontSize':B=new FCKFontSizeCommand();break;case 'FontFormat':B=new FCKFormatBlockCommand();break;case 'Source':B=new FCKSourceCommand();break;case 'Preview':B=new FCKPreviewCommand();break;case 'Save':B=new FCKSaveCommand();break;case 'NewPage':B=new FCKNewPageCommand();break;case 'PageBreak':B=new FCKPageBreakCommand();break;case 'TextColor':B=new FCKTextColorCommand('ForeColor');break;case 'BGColor':B=new FCKTextColorCommand('BackColor');break;case 'PasteText':B=new FCKPastePlainTextCommand();break;case 'PasteWord':B=new FCKPasteWordCommand();break;case 'TableInsertRow':B=new FCKTableCommand('TableInsertRow');break;case 'TableDeleteRows':B=new FCKTableCommand('TableDeleteRows');break;case 'TableInsertColumn':B=new FCKTableCommand('TableInsertColumn');break;case 'TableDeleteColumns':B=new FCKTableCommand('TableDeleteColumns');break;case 'TableInsertCell':B=new FCKTableCommand('TableInsertCell');break;case 'TableDeleteCells':B=new FCKTableCommand('TableDeleteCells');break;case 'TableMergeCells':B=new FCKTableCommand('TableMergeCells');break;case 'TableSplitCell':B=new FCKTableCommand('TableSplitCell');break;case 'TableDelete':B=new FCKTableCommand('TableDelete');break;case 'Form':B=new FCKDialogCommand('Form',FCKLang.Form,'dialog/fck_form.html',380,230);break;case 'Checkbox':B=new FCKDialogCommand('Checkbox',FCKLang.Checkbox,'dialog/fck_checkbox.html',380,230);break;case 'Radio':B=new FCKDialogCommand('Radio',FCKLang.RadioButton,'dialog/fck_radiobutton.html',380,230);break;case 'TextField':B=new FCKDialogCommand('TextField',FCKLang.TextField,'dialog/fck_textfield.html',380,230);break;case 'Textarea':B=new FCKDialogCommand('Textarea',FCKLang.Textarea,'dialog/fck_textarea.html',380,230);break;case 'HiddenField':B=new FCKDialogCommand('HiddenField',FCKLang.HiddenField,'dialog/fck_hiddenfield.html',380,230);break;case 'Button':B=new FCKDialogCommand('Button',FCKLang.Button,'dialog/fck_button.html',380,230);break;case 'Select':B=new FCKDialogCommand('Select',FCKLang.SelectionField,'dialog/fck_select.html',400,380);break;case 'ImageButton':B=new FCKDialogCommand('ImageButton',FCKLang.ImageButton,'dialog/fck_image.html?ImageButton',450,400);break;case 'SpellCheck':B=new FCKSpellCheckCommand();break;case 'FitWindow':B=new FCKFitWindow();break;case 'Undo':B=new FCKUndoCommand();break;case 'Redo':B=new FCKRedoCommand();break;case 'Undefined':B=new FCKUndefinedCommand();break;default:if (FCKRegexLib.NamedCommands.test(A)) B=new FCKNamedCommand(A);else{alert(FCKLang.UnknownCommand.replace(/%1/g,A));return null;}};FCKCommands.LoadedCommands[A]=B;return B;};FCKCommands.GetFullPageState=function(){return FCKConfig.FullPage?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;};
    但始终不见有Table属性的扩展啊.
      

  17.   

    万一不行,我就把它扩展保存到summary这个属性好了.
      

  18.   

    哪位高手能告诉我一下在fck_table.html中的function Ok()中我使用
    table.style="left: 80px; width: 227px; position: absolute; top: 100px";它为什么报错啊.居然说没有style的属性,应该怎么做啊?
      

  19.   

    style属性好象不是这么用的吧,应该要用JAVA语言来实现!
      

  20.   

    table是什么,是你生成的表格ID吗?如果不是ID你那么用是错误的。正确的用法是
    document.getElementById('表格id').style.left='80px';
    document.getElementById('表格id').style.width='227px';
    ...
    ...
    ...
      

  21.   

    document.getElementById('表格id').style.left='80px';
    document.getElementById('表格id').style.width='227px';
    支持这种..
      

  22.   

    大哥Ok函数的原文是:
    function Ok()
    {
    var bExists = ( table != null ) ;

    if ( ! bExists )
    {
    table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
    } // Removes the Width and Height styles
    if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ;
    if ( bExists && table.style.height ) table.style.height = null ; //.removeAttribute("height") ;

    table.width = document.getElementById('txtWidth').value + ( document.getElementById('selWidthType').value == "percent" ? "%" : "") ;
    table.height = document.getElementById('txtHeight').value ;
    table.border = document.getElementById('txtBorder').value ;
    table.align = document.getElementById('selAlignment').value ;
    table.cellPadding = document.getElementById('txtCellPadding').value ;// document.getElementById(table).styles.left='80px';
      //  table.style.position="absolute";
        //table.style.left='80px';
    // table.left =200;
    // table.top=100;
    // table.styles="absolute;top:100";
    //alert(table.innerCODE);

    //table.cellSpacing = document.getElementById('txtCellSpacing').value ;
    //table.summary       = document.getElementById('txtSummary').value +"style='left: 80px; width: 227px; position: absolute; top: 100px'";
    //table.style="left: 80px; width: 227px; position: absolute; top: 100px";
    //table.style=document.getElementById('txtSummary').value ;
    // table.className = cmbFontStyle.value ;

    if ( document.getElementById('txtCaption').value != '')
    {
    if (! table.caption) table.createCaption() ;
    //
    table.caption.innerHTML = document.getElementById('txtCaption').value ;
    }
    else if ( bExists && table.caption )
    {
    if ( document.all )
    table.caption.innerHTML = '' ; // TODO: It causes an IE internal error if using removeChild.
    else
    table.caption.parentNode.removeChild( table.caption ) ;
    }

    if (! bExists)
    {
    var iRows = document.getElementById('txtRows').value ;
    var iCols = document.getElementById('txtColumns').value ;

    for ( var r = 0 ; r < iRows ; r++ )
    {
    var oRow = table.insertRow(-1) ;
    for ( var c = 0 ; c < iCols ; c++ )
    {
    var oCell = oRow.insertCell(-1) ;
    if ( oEditor.FCKBrowserInfo.IsGecko )
    oCell.innerHTML = '<br _moz_editor_bogus_node="TRUE">' ;
    //oCell.innerHTML = "&nbsp;" ;
    }
    }

    oEditor.FCKUndo.SaveUndoStep() ;

    // START iCM MODIFICATIONS
    // Amended to ensure that newly inserted tables are not incorrectly nested in P tags, etc
    // We insert the table first and then rectify any nestings afterwards so we can re-use the
    // FCKTablesProcessor function that corrects tables on SetHTML()
    /*
    table = oEditor.FCK.InsertElementAndGetIt( table ) ;
    if ( !oEditor.FCKConfig.UseBROnCarriageReturn )
    {
    oEditor.FCKTablesProcessor.CheckTableNesting( table ) ;
    }
    */
    // END iCM MODIFICATIONS

    oEditor.FCK.InsertElement( table ) ;
    }

    return true ;
    }
      

  23.   

    上面上些代码被我注掉了,您这种document.getElementById('表格id').style.width='227px';
    应该是正确的,不过在这里有点不好使,他说的错误是缺少对像,不过在您的点拨下我终于把问题解决了,原来table.style.left='80px'这样写就对啦./谢谢各位
      

  24.   

    有哪位大哥知道把这个贴子中生成的有特殊标识字符的Table,在后台中用javaSicpt把它的属性取出来吗?(或者不用javaScript也行,只要能取出来) 
      

  25.   

    继承一个table,加上自己的属性。
      

  26.   

    可以这样试试:
    通过tagName把所有该类对象取出来
    var tables = document.getElementsByTagName("TABLE");
    循环判断
    for(var i = 0, l = tables.length; i < l; i++)
    {
        if (tables[i].style.left == '80px'){
        //想要的操作,保存表格的话就取outerHTML
        }
    }
    大概是这样,具体的可以自己根据情况处理。
      

  27.   

    http://my.jcwcn.com/?23883/action_viewspace_itemid_8211