user1790785 user1790785 - 3 years ago 171
HTML Question

Formatting of html tables in GSP

I am using Grails and I am currently faced with this problem.

This is the result of my html table
enter image description here

And this is my code from the gsp page

<th>Device ID</th>
<th>Device Type</th>
<g:each in = "${reqid}">

<g:each in ="${custname}">

So the problem is, how do I format the table such that the "LHCT271 , 2 , Thomasyeo " will be shifted down accordingly? I've tried to add the
tags here and there but it doesn't work.. any help please?

Answer Source

I think you problem is not in the view, but in the controller (or maybe even the domain). You must have some way of knowing that reqid and custname are related if they are in the same table. You must use that to construct an object that can be easily used in a g:each

You are looking for a way to mix columns and rows, and still get a nice table. I'm afraid that is not possible.


(Sorry, I just saw the last comment.)

You cannot mix two items in a g:each.

Furthermore, if the two things are not related you probably must not put them in the same table. There will be no way for you or for Grails, to know how to properly organize the information

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download