/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
config.toolbar = 'Full';
config.toolbar_Full = [
//'FontSize','RemoveFormat'
['Cleanup','Bold','Italic','NumberedList','BulletedList', 'Blockquote', 'pbckcode','WecenterImage', 'WecenterAttach', 'WecenterLink', 'WecenterVideo', 'Table','Maximize']
]
config.extraPlugins = 'autolink,pbckcode,bbcode,sourcearea,wecenterattach,wecenterimage,wecenterlink,wecentervideo,blockquote,font,table';
config.resize_enabled = false;
config.language = 'zh-cn';
config.skin = 'bootstrapck';
config.height = 250;
// 过滤粘贴内容
config.forcePasteAsPlainText = true;
config.magicline_color = '#ccc';
config.magicline_everywhere = true;
config.fontSize_sizes = '16px;18px';
// The default plugins included in the basic setup define some buttons that
// are not needed in a basic editor. They are removed here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
// Dialog windows are also simplified.
config.removeDialogTabs = 'link:advanced';
config.removePlugins = 'enterkey,elementspath,contextmenu';
};
然后去ckeditor 官网下载了表格插件,并上传到服务器,
在编辑问题时可以插入表格
但是问题时,在问题页面却无法显示,请问有人知道如何解决么?AI智能回复搜索中,请稍后...
1 回答
private function _tt_callback($match)
{
return "$this->bbcode_table["/\[table\](.*?)\[\/table\]/is"] = '_tt_callback';其他的自行模仿(tr、 td) 2、修改static/js/editor/ckeditor/plugins/bbcode/的plugin.js 第29行至33行修改为
var bbcodeMap = {table:'table', td:'td', tr:'tr', b: 'strong', u: 'u', i: 'em', color: 'span', size: 'span', quote: 'blockquote', code: 'pre', url: 'a', email: 'span', img: 'span', '*': 'li', list: 'ol', pre: 'pre', video: 'video'},
convertMap = {table:'table',td:'td',tr:'tr', strong: 'b', b: 'b', u: 'u', em: 'i', i: 'i', code: 'code', li: '*', pre: 'code' },
tagnameMap = { table:'table',td:'td',tr:'tr',strong: 'b', em: 'i', u: 'u', li: '*', ul: 'list', ol: 'list', code: 'code', a: 'link', img: 'img', blockquote: 'quote' },
stylesMap = { color: 'color', size: 'font-size' },
attributesMap = { url: 'href', email: 'mailhref', quote: 'cite', list: 'listType' };
3、去CKeditor下载Table相关插件上传至static/js/editor/ckeditor/plugins/ 插件目录下
4、在CSS中添加表格的样式,否则无法显示表格边框
添加后表格效果如下