如何在ckeditor中定义cols

时间:2015-07-06 20:37:14

标签: javascript java ckeditor

如何使用ckEditor在文本区域中定义cols,在许多站点中读取并找不到答案。我把隐式代码放了,但它不起作用。

<textarea id="ckEditor" name="ckEditor" rows="25" cols="30" ></textarea>

Config.js

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.allowedContent = true;   
config.extraPlugins = 'imprimirdoc';
config.toolbar = [{name: 'styles', items:['Font','FontSize']},{name: 'basicstyles', items: ['Bold', 'Italic','Underline']},['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord','-', 'Undo', 'Redo'],{name: 'document', items:['imprimirdoc','Preview']},{name: 'editing', items: ['Find','SelectAll','-','Scayt']},'/',                                                                                                                                                        
                 {name: 'paragraph', items:['NumberedList','BulletedList','-','Outdent', 'Indent', '-', 'Blockquote','-', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','BidiLtr','BidiRtl' ]},
                 {name: 'insert', items:['Table','HorizontalRule','SpecialChar', 'PageBreak']},
                 {name: 'colors', items:['TextColor', 'BGColor']},
                 {name: 'tools', items: [ 'Maximize']}];
config.pasteFromWordRemoveStyles = false;
config.contentsCss = ['contents.css'];
config.cols = 10;

1 个答案:

答案 0 :(得分:0)

描述了调整文本编辑器大小的默认方式here 或者,您也可以按照here

所述在配置中调整大小

为了更好地格式化,z_newswidth优先于heightcols - 大小为rows,而不是像素。