如何将行号添加到Kendo UI编辑器。我看不到任何可以启用行号的设置http://docs.telerik.com/kendo-ui/controls/editors/editor/Editor/overview
使用CSS3计数器有一条路由。我不熟悉Kendo编辑器,因此请务必在CSS中添加p
和ul > li
基本子元素以外的其他元素。
您可以保存以下CSS,要加载编辑器中:
body {
counter-reset: editor;
padding-left: 3em;
}
body > p,
body > ul > li {
counter-increment: editor;
}
body > p:before,
body > ul > li:before {
content: counter(editor);
background: #CCC;
position: absolute;
left: 1em;
height: 100%;
width: 2em;
}
要在编辑器中添加自定义CSS,您可以将上述保存在文件中和初始化中:
$("#editor").kendoEditor({
stylesheets: ["path_to_your.css"]
});