Title: RE: [displaytag-user] How can I colspan ?

You can use a TableDecorator to add the extra row to the table.

Override the finishRow() method and use the this.getCurrentRowObject() to retrieve the object that is being used as the data for the row. You can then cast this object to the correct type and access its methods like so:

public String finishRow() {
        MyBean myBean = (MyBean)this.getCurrentRowObject();
        return "<tr><td colspan="3">" + myBean.getDescription() + "</td></tr>";
}

Nice.

Ed!

-----Original Message-----
From: Anoop Sreenivasan [mailto:[EMAIL PROTECTED]]
Sent: 29 January 2004 18:10
To: [EMAIL PROTECTED]
Subject: [displaytag-user] How can I colspan ?


Hi,
This is a wonderful set of tags!

I have a requirement like this.

I have a list of projects with their Ids, names and creation date. I also have the description of the project.

so I need a structure like this:

<table>
    <tr><td>project_Id1</td><td>project_name</td><td>project_creat_date1</td></tr>
<tr><td colspan=3>this is the place where description comes spanning over multiple columns</td></tr>
.....
</table>

Is this possible using the display tag?

Thanks in Advance,
Anoop Sreenivasan

Reply via email to