ueditor外部粘入表格时表格样式浏览器不兼容
环境:spring+mvc+mybatis+ueditor1.4.3.2jsp版本utf-8问题描述:谷歌版本47.0.2526.106m下:从外部粘贴表格进uedito...
环境:spring+mvc+mybatis+ueditor1.4.3.2jsp版本utf-8
问题描述:
谷歌 版本 47.0.2526.106 m 下:从外部粘贴表格进ueditor如下:
原表格截图:
表格粘入ueditor后:
表格粘入后td样式
IE9下此图粘入ueditor:
IE9下表格:
粘入ueditor:
IE9下粘入的html
与谷歌下的区别是保存到数据库后的html代码谷歌下缺少表格原本边线样式。需要右击表格设置边线可见。这样的话在读出来的数据表格样式就会发生改变。另IE10和火狐下表格粘入后没有任何样式只有数值。求教!!!待会附上表格html代码
字数超限尴尬 展开
问题描述:
谷歌 版本 47.0.2526.106 m 下:从外部粘贴表格进ueditor如下:
原表格截图:
表格粘入ueditor后:
表格粘入后td样式
IE9下此图粘入ueditor:
IE9下表格:
粘入ueditor:
IE9下粘入的html
与谷歌下的区别是保存到数据库后的html代码谷歌下缺少表格原本边线样式。需要右击表格设置边线可见。这样的话在读出来的数据表格样式就会发生改变。另IE10和火狐下表格粘入后没有任何样式只有数值。求教!!!待会附上表格html代码
字数超限尴尬 展开
1个回答
2016-04-27
展开全部
这个样式不是用css定义的,你试着引入下载的完整源码包里面的ueditor1_4_3-src\_parse\list.js 和
ueditor1_4_3-src\_src\plugins\list.js 试试,ol的样式是通过这两个js生成的。
-------------------------------------------------------------------------------
ueditor1_4_3-src\_src\plugins\list.js 片段:
-------------------------------------------------------------------------------
me.ready(function () {
var customCss = [];
for(var p in customStyle){
if(p == 'dash' || p == 'dot'){
customCss.push('li.list-' + customStyle[p] + '{background-image:url(' + liiconpath +customStyle[p]+'.gif)}');
customCss.push('ul.custom_'+p+'{list-style:none;}ul.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}');
}else{
for(var i= 0;i<99;i++){
customCss.push('li.list-' + customStyle[p] + i + '{background-image:url(' + liiconpath + 'list-'+customStyle[p] + i + '.gif)}')
}
customCss.push('ol.custom_'+p+'{list-style:none;}ol.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}');
}
switch(p){
case 'cn':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}');
break;
case 'cn1':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:30px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}');
break;
case 'cn2':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:55px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:68px}');
break;
case 'num':
case 'num1':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}');
break;
case 'num2':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:35px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
break;
case 'dash':
customCss.push('li.list-'+p+'-paddingleft{padding-left:35px}');
break;
case 'dot':
customCss.push('li.list-'+p+'-paddingleft{padding-left:20px}');
}
}
customCss.push('.list-paddingleft-1{padding-left:0}');
customCss.push('.list-paddingleft-2{padding-left:'+me.options.listDefaultPaddingLeft+'px}');
customCss.push('.list-paddingleft-3{padding-left:'+me.options.listDefaultPaddingLeft*2+'px}');
//如果不给宽度会在自定应样式里出现滚动条
utils.cssRule('list', 'ol,ul{margin:0;pading:0;'+(browser.ie ? '' : 'width:95%')+'}li{clear:both;}'+customCss.join('\n'), me.document);
});
ueditor1_4_3-src\_src\plugins\list.js 试试,ol的样式是通过这两个js生成的。
-------------------------------------------------------------------------------
ueditor1_4_3-src\_src\plugins\list.js 片段:
-------------------------------------------------------------------------------
me.ready(function () {
var customCss = [];
for(var p in customStyle){
if(p == 'dash' || p == 'dot'){
customCss.push('li.list-' + customStyle[p] + '{background-image:url(' + liiconpath +customStyle[p]+'.gif)}');
customCss.push('ul.custom_'+p+'{list-style:none;}ul.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}');
}else{
for(var i= 0;i<99;i++){
customCss.push('li.list-' + customStyle[p] + i + '{background-image:url(' + liiconpath + 'list-'+customStyle[p] + i + '.gif)}')
}
customCss.push('ol.custom_'+p+'{list-style:none;}ol.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}');
}
switch(p){
case 'cn':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}');
break;
case 'cn1':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:30px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}');
break;
case 'cn2':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:55px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:68px}');
break;
case 'num':
case 'num1':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}');
break;
case 'num2':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:35px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
break;
case 'dash':
customCss.push('li.list-'+p+'-paddingleft{padding-left:35px}');
break;
case 'dot':
customCss.push('li.list-'+p+'-paddingleft{padding-left:20px}');
}
}
customCss.push('.list-paddingleft-1{padding-left:0}');
customCss.push('.list-paddingleft-2{padding-left:'+me.options.listDefaultPaddingLeft+'px}');
customCss.push('.list-paddingleft-3{padding-left:'+me.options.listDefaultPaddingLeft*2+'px}');
//如果不给宽度会在自定应样式里出现滚动条
utils.cssRule('list', 'ol,ul{margin:0;pading:0;'+(browser.ie ? '' : 'width:95%')+'}li{clear:both;}'+customCss.join('\n'), me.document);
});
追问
好的,谢谢!我稍后会试试,不过我这是从外部粘贴表格。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询