tags:

views:

1274

answers:

2

In jsp I'm using Display tag to print a table. In Display table tag, on giving a property in the display:column tag, that property gets printed as a column. What should I do to print the same as a row?

Let me give an example for clarity:

<display:table name="test">
  <display:column property="id" title="ID" />
  <display:column property="name" />
</display:table>

The result of this would be:

ID     Name
1      Foo
2      Bar

But i want it to be dispalyed row-wise like this:

ID        1        2
Name   Foo   Bar

How can this be done using display table tag? Any help would be much appreciated.

+1  A: 

Unless they made some major changes last couple of months (i doubt it), this cannot be done with display tag.

Check http://displaytag.sourceforge.net/1.2/ for more information on the display tag.

tehvan
A: 

Sorry, display:table does not have a display:row type tag.

Do you know ahead of time how many columns are going to be displayed? If so you might be able to adjust your object model to rotate it, then be able to get displaytag to write out the table you want.

If not, you may want to rethink your horizontal design, as monitor's are only so wide.

Do you plan on having the columns wrap when many are painted? If so, an html table is probably not going to be your best display mechanism.

Nathan Feger