Reputation: 385
I want to show data from my server to view as like the above image.In java, How can i arrange data structure in my server to view like this? Is there any particular data structure in java to do like this?
Upvotes: 0
Views: 1093
Reputation: 13890
Object [][] structure = new Object [5][];
structure [0] = new Object [] {c1_d1, c1_d1, c1_d1, c1_d1}; // col1
structure [1] = new Object [] {c2_d1, c2_d2, c2_d2, c2_d2}; // col2
structure [2] = new Object [] {c3_d1, c3_d2, c3_d2, c3_d3}; // col3
structure [3] = new Object [] {c4_d1, c4_d2, c4_d3, c4_d4}; // col4
structure [4] = new Object [] {c5_d1, c5_d2, c5_d3, c5_d4}; // col5
Each column is represents by an array and merged cells represents by range of array elements storing reference to the same object.
Upvotes: 1