0

I want to save in 5 columns values in 5 different arraylist. I tried using jquery it’s not working.

World Wide North America Latin America EMEA APJ App1 App4 App7 App10 App13 App2 App5 App8 App11 App14 App3 App6 App9 App12 App15

Something like this:

World Wide     North America    Latin America   EMEA     APJ
App1              App4              App7       App10    App13
App2              App5              App8       App11    App14
App3              App6              App9       App12    App15

Please help me in this.

Mr_Green
  • 40,727
  • 45
  • 159
  • 271
  • 2
    I don't see JavaScript in your question. I don't see any code at all. How is this table being build? – Rene Pot Jun 03 '13 at 09:41
  • this link may help you : http://stackoverflow.com/questions/1168807/how-can-i-add-a-key-value-pair-to-a-javascript-object-literal – Naresh J Jun 03 '13 at 09:44
  • can You elaborate some more points regarding your question,what exactly the problem you are facing and what all efforts you have done to achieve your task?or just update your jquery code in your question. -- asked by Jayesh Jain – John Dvorak Jun 03 '13 at 10:04
  • @Jan Dvorak: I'm using Spring MVC controlled to fetch the values from database and display these values in table. –  Jun 04 '13 at 04:36
  • Each column values should be saved in an arraylist –  Jun 04 '13 at 04:37

1 Answers1

0

It will be easy if you go with div's instead of using table. Here is a demo:

HTML

<div id="main"></div>

JS

var text = "World_Wide North_America Latin_America EMEA APJ App1 App4 App7 App10 App13 App2 App5 App8 App11 App14 App3 App6 App9 App12 App15";
var main = document.getElementById('main');
var newText = text.split(' ').join("</div><div>");
main.innerHTML = "<div>" + newText + "</div>";

CSS

#main>div {
    width: 20%;
    float: left;
}
#main {
    width: 100%;
}

Working Fiddle

PS: For understanding, I kept underscore to the words which needs to be in a single block.

Mr_Green
  • 40,727
  • 45
  • 159
  • 271
  • JSP Code:

    OOBE Tool

    ${countryMap.key}
    ${countryname}
    –  Jun 04 '13 at 04:34
  • @Divya I can't understand why you posted the code above? Would you care to explain? – Mr_Green Jun 04 '13 at 05:11
  • for each column in my table I have used 5 different arraylist to store these values, that worked as I expected.. –  Jun 04 '13 at 05:59
  • @Divya Happy that you solved your problem. If my solution helped you by any means then please accept it as answer :). – Mr_Green Jun 04 '13 at 06:04