How to implement merging cells in aem richtext component? | Community
Skip to main content
sherybedrock
Level 3
December 16, 2016
Question

How to implement merging cells in aem richtext component?

  • December 16, 2016
  • 4 replies
  • 1595 views

Hi all,

i need some help. I want to implement a merging cells in my richtext dialog. I added the rte plugin and save the table structure in the crx-e , but i want to apply different styles for nestet tables. Is somebody implementing this in java?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

smacdonald2008
Level 10
December 16, 2016

What Java API are you looking at using? 

sherybedrock
Level 3
December 16, 2016

Actually I am trying to figure out how to approach. AEM now gives me ready html table, but i should use specific css classes. Have you used any api for this purpose? For example Jsoup.

smacdonald2008
Level 10
December 16, 2016

I was talking to some internal ppl - they stated: It can be done on server by parsing the text.  I am looking for some examples for you. 

kautuk_sahni
Adobe Employee
Adobe Employee
December 19, 2016

Hi 

As mentioned by Scott, You need to do some server side implementation to do the need full.

otherwise you can create a custom component with many Jquery Table plugins to do all table related operations.

Link:- http://www.jqueryscript.net/tags.php?/data%20table/

To merge the cells of the table you can write a small java-script code link:-

$('table tr > :nth-child(3)').append(function() {
    return $(this).next().remove().contents();
});

Output:- 

                     
12345
12345
12345

column 3 and 4 got merged.

~kautuk

Kautuk Sahni