Expand my Community achievements bar.

How to implement merging cells in aem richtext component?

Avatar

Level 3

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?

4 Replies

Avatar

Level 10

What Java API are you looking at using? 

Avatar

Level 3

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.

Avatar

Level 10

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. 

Avatar

Administrator

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