Adding html class to tinymce td element

假如想象 提交于 2019-12-13 06:47:49

问题


:)

It is my second post here in stackoverflow and got happy with the results of my first question. Anyway, I already have a working tinymce toolbar with a re-designed appearance. In achieving this I have used jQuery to add classes to the toolbar elements.

But in some way isn't it better if upon initializing the toolbars the classes are also added..

let's say: theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,"

currently: (the one that i have now)

  • initiate tinymce
  • find elements add class while there are elements

Result:

   <td class="first"> (*save elements here) </td>
   <td class="last"> (*newdocument elements here) </td>
   <td class="separator"> (*separator element here) </td>
   <td class="first"> (*bold elements here) </td>
   <td class="center"> (*italic elements here) </td>
   <td class="center"> (*underline elements here) </td>
   <td class="last"> (*strikethrough elements here) </td>

what I want to achieve: - initiate tinymce and add classes (*the result would be the same)

wouldn't it be faster this way? I have been tracing the codes of tinymce but with my inexperience in coding makes it more harder for me... Anyone out there who knows the answer to my problem.. Please help me.. thank you and more power... :)


回答1:


Looks like you should use the configuraton setting editor_css.



来源:https://stackoverflow.com/questions/10338173/adding-html-class-to-tinymce-td-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!