cancel
Showing results for 
Search instead for 
Did you mean: 

Arrange the elements from top to bottom in 4 columns.

Former Member
0 Kudos

Hi,

How to arrange the elements from top to bottom in 4 columns ?

In gridlayout colcount is set as 4 and is giving output as :

A B C D

E F G H

I J K

and so on

but I want output as

A D G J

B E H K

C F I

Please help.

Thanks & Regards,

Jyotsna

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

Use transparent containers for each column.

Sarbjeet Singh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi ,

Try this way , create a table with four columns ..

if your display values are in a variable "a" i.e String a[] = {"a","b","c","d","e","f","g","h","i","j","k"};

use the below code to display the values

code: /////////////////////////////////////////////////////////

int len = a.length;

for (int j = 0 ; j<3;j++)

{

ele = wdContext.node<table>().create<table>Element();

ele.setA(a[j]);

if(j+3 < len)

ele.setB(a[j+3]);

if(j+6 < len)

ele.setC(a[j+6]);

if(j+9 < len)

ele.setD(a[j+9]);

node.addElement(ele);

}

/////////////////////////////////////////////////

modify the varibles according to youe req...

Regards,

Sunitha Hari

Edited by: Sunitha Hari on Sep 1, 2010 2:56 PM

Former Member
0 Kudos

Hi Jyotsna,

Are you using a table?Can you be more detailed on your requirement?

Put all the elements of the matrix in the array.

Arrange in the ascending order.

Split it into four.

Best Wishes

Idhaya R

yogesh_galphade
Contributor
0 Kudos

try with Matrix layout.

or use 4 transparent container, parent root container with GRID layout.

child 4 containers with grid layout 1 column.

Edited by: Yogesh Galphade on Sep 1, 2010 11:56 AM