When we paste modern tables into RTE, we see that <thead> is removed and <tbody> is added to wrap the whole table. This is unacceptable markup. How do we use <thead> in our embedded tables?
Solved! Go to Solution.
trench999 wrote...
I think this is a case of an RTE not being able to easily protect a user against making a mess, but there should be some way to allow an override. The last bullet: How does one configure this?
Unfortunately, Currently it is not built in. If you have strong business case please reopen the daycare ticket OR create a new ticket and request for "prefer preserve" option for rte to leave <thead> information "as is".
Views
Replies
Total Likes
Look at Class CQ.form.rte.plugins.TablePlugin, defaultValues has header set to "none" - which means it would not include <thead> (table header) tags, and thus might be causing this issue.
http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.form.rte.plugins.Plugin
Defaults to: { "cellspacing": "0", "cellpadding": "1", "border": "1", "columns": "3", "rows": "2", "header": "none", "tableTemplate": null }
We're actually not using the table plugin. We're simply pasting html into source. Does this still apply?
Views
Replies
Total Likes
When working with RTE in a component, typically its done via a component dialog built using JCR nodes and then plug-ins are configured so that additional functionality is added, as described here.
http://dev.day.com/docs/en/cq/5-5/administering/configuring_rich_text_editor.html
You are not using a RTE this way?
Views
Replies
Total Likes
This use case is specifically in our tailored Text Editor that is primarily the RTE widget. We are using some plugins, but not the table one for some UX reasons. During automated migrations we have some tables coming into these RTE widgets and simply need the <thead> to stay intact.
We talked to Day Care about this and received a thorough reply:
---------
The reported issue is a known limitation of CQ 5.6.1. The similar bug was already opened with R&D on behalf of another AEM customer. The response from our development team was the following:
Please note that it is generally not possible to keep HTML "as is" for WYSIWYG editing, as some adjustments are simply required to make a HTML fragment editable at all. It is strongly recommended to use a non-WYSIWYG component for texts that really require preserving HTML "as is".
Non-exhaustive list of automatic DOM changes:
In this special case (_<thead>_), none of the "popular" RTE's (_CKeditor_, _TinyMCE_) does fully support _<thead>_. CKeditor creates and manages a <thead> section under several intransparent circumstances, but creates invalid HTML if for example a cell from _<thead>_ is merged with a cell from _<tbody>_. TinyMCE doesn't allow to create _<thead>_ at all, but actually preserves it if inserted from source code view. If the user tries to merge cells from _<thead>_ and _<tbody>_, it doesn't allow so.
-----
I think this is a case of an RTE not being able to easily protect a user against making a mess, but there should be some way to allow an override. The last bullet: How does one configure this?
Views
Replies
Total Likes
trench999 wrote...
I think this is a case of an RTE not being able to easily protect a user against making a mess, but there should be some way to allow an override. The last bullet: How does one configure this?
Unfortunately, Currently it is not built in. If you have strong business case please reopen the daycare ticket OR create a new ticket and request for "prefer preserve" option for rte to leave <thead> information "as is".
Views
Replies
Total Likes
HI All,
I have tried the above solution but seems that its only generates <th> element but not <thead> element in the table.
Has anyone found out any solution to include <thead>?
Thanks,
Mayur
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies