Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Anat Paco

Greenhorn
+ Follow
since Apr 11, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anat Paco

I know this answer is too late for you, but maybe someone in the web will find it as useful.
in order to add colspan attribute for TH in displaytag (or other HTML attribute) you should do the follwing:
1. create a table decorator (extend TableDecorator)
2. override the method init(PageContext pageContext, Object decorated, TableModel tableModel)
3. in the init method add html attribute like this:
HeaderCell oneHeader;
List headersList = tableModel.getHeaderCellList();
for (int i =0; i< headersList.size(); i++)
{
oneHeader = (HeaderCell) headersList.get(i);
HtmlAttributeMap oneHtmlAttributeMap = oneHeader.getHeaderAttributes();
oneHtmlAttributeMap.put("colSpan", "3");
oneHeader.setHtmlAttributes(oneHtmlAttributeMap);
}

now, each th in your table has html attribute colSpan=2.

enjoy.