If you want to have the first column of a table in a special layout or the 
last, a special css treatment is needed. In this cases it is very helpful to 
have an id-attribute in the <td> tag. So I overwrite cellContainer
 
 
@Override

protected Item newCellItem(MarkupContainer cellContainer, final String id, int 
index, final IModel model) {

cellContainer.add(new AttributeModifier("id", true, new 
Model<String>("BLAFASELTRALALA")));

Item item = new Item(cellContainer, id, index, model);

int columns = getColumns().length;

String idAttribute = "single";

if (columns > 1) {

if (index == 0)

idAttribute = "left";

else if (index == columns - 1)

idAttribute = "right";

else

idAttribute = "middle";

}

item.add(new AttributeModifier("id", true, new Model<String>(idAttribute)));

return item;

}

 

 

 

And each cell is marked as "left", "middle" or "right" or "single" if the table 
has only on column. Now I can easily do things like this in css:

#left { border-left: 2px solid rgb(34,69,104);
}

To complete the appearence, it would be nice to have the same thing for the 
table header. Yes, of cource, I saw the examle cde and the resulting tables 
look very pretty, but the customer's whish....

I think, the integration of something like the above code would help some 
people (see Leszek Gawron's reply)

 

Stefan Lindner


<<winmail.dat>>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to