Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

318
Views
Diaplaying unique element into the html table through JQuery

I need to display unique elements of already binded data in that html table by using JQuery or JavaScript. Displaying unique value means that mearging the cells having same value in the rows. The table data is dynamic but the structure is fix.

So, here is given table:

Given Table Data

Here, I need to merge the Red colored cells as shown below.

And the required table is:

Required Table

So, I need to achieve this cell merging through Jquery or javascript. As this table is created with HTML table and the data is already binded in it. By using this binded data I need to achieve the reqiured table. I need to merge more columns like this.

I have tried some coding but it is not working correctly. The code is:

jQuery('tr.tblRow').each(function(i, obj)
{   
     current_name = jQuery(obj).text();

     var current_name_arr = current_name.split(/\t|\n| /);

     /* check for repeated names */
     if (current_name_arr[22] == last_selected_compNo)
     {
          jQuery("td.headingSpas:contains('" + current_name_arr[22] + "')").each(function(index, object) 
          {
                if (index == 0)
                {
                /* check if already has rowspan attribtue */
                row_span = jQuery(object).attr('rowspan') ? jQuery(object).attr('rowspan') : 1;

                /* add one */
                row_span++;

                /* include the new rowspan number  */
                jQuery(object).prop('rowspan', row_span);

           }
           else if(index < 2)
           {
                 /* delete the other first name cells */
                 jQuery(object).remove();
           }
        
       });
    }
}

Please help me.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!