处理ueditor添加表格没有边框的问题

修改ueditor.all.js
边框的原理是给table border-left:1px solid #666; border-top:1px solid #666;给td border-bottom:1px solid #666; border-right:1px solid #666;

     utils.each(tables, function (table) {                        
                    //粘贴进来的表格table定义属性
                    domUtils.setAttributes(table, {
                        style:'border-left:1px solid #666; border-top:1px solid #666;',align:'center',
                    });                                            

                    removeStyleSize(table, true);
                    //domUtils.removeAttributes(table, ['style', 'border']);
                    //domUtils.removeAttributes(table, ['style']);//no remove table Style
                    utils.each(domUtils.getElementsByTagName_r(table, "td"), function (td) {

                        //粘贴进来的表格td定义属性
                        domUtils.setAttributes(td, {
                            style:'border-bottom:1px solid #666; border-right:1px solid #666; padding:5px;',
                        });                        

                        if (isEmptyBlock(td)) {
                            domUtils.fillNode(me.document, td);
                        }
                        removeStyleSize(td, true);
                        //domUtils.removeAttributes(td, ['style'])
                    });
                });

猜你喜欢

转载自blog.csdn.net/lyf8297/article/details/80492901
今日推荐