You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Swarnim Ranjitkar <sw...@hotmail.com> on 2009/10/14 01:06:44 UTC

Right justify in DataTable

If I user DefaultDataTable to display table. Is there a way justify the numberic column. eg.  I want NumberCol to be right justified then left    

        IColumn[] columns = new IColumn[2];
        columns[0] = new PropertyColumn(new Model("NumberCol"), "NumberCol", "NumberCol")
        columns[1] = new PropertyColumn(new Model("Last Name"), "name.last", "name.last");
        
        DefaultDataTable table = new DefaultDataTable("datatable", columns, userProvider, 10);
 		 	   		  

Re: Right justify in DataTable

Posted by Swanthe Lindgren <sw...@megasol.se>.
Try this (cut and pasted from the inmethod-grid-examples app)

new PropertyColumn(new ResourceModel("NumberCol"), "NumberCol", 
"NumberCol") {
            private static final long serialVersionUID = 1L;
            @Override
            public String getCellCssClass(IModel rowModel, int rowNum) {
                return "myCssClassThatRightJustifies";
            }
        };

//Swanthe

Swarnim Ranjitkar wrote:
> If I user DefaultDataTable to display table. Is there a way justify the numberic column. eg.  I want NumberCol to be right justified then left    
>
>         IColumn[] columns = new IColumn[2];
>         columns[0] = new PropertyColumn(new Model("NumberCol"), "NumberCol", "NumberCol")
>         columns[1] = new PropertyColumn(new Model("Last Name"), "name.last", "name.last");
>         
>         DefaultDataTable table = new DefaultDataTable("datatable", columns, userProvider, 10);
>  		 	   		  
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org