Hi Thomas, thank you very much for your answer, 

Actually, in my real application, I have a 
List<Integer[]> rowColIntersectionList=new ArrayList<Integer[]>();

Integer[] int1={0,1};
Integer[] int2={0,2};
Integer[] int3={1,1};
Integer[] int4={1,2};
Integer[] int5={2,2);

But I can't create the Css styles dynamically. The css styles are all fixed.

I want to set the cells Bold dynamically, so do you have any idea how to do 
that?


On Monday, March 24, 2014 8:51:42 PM UTC+11, Thomas Broyer wrote:
>
>
>
> On Monday, March 24, 2014 6:52:38 AM UTC+1, Tom wrote:
>>
>> Hi Thomas, I tried, it almost done, BUT...
>>
>> Suppose I want to style the cell that is the intersection of the 
>> following Row Index and Column Index: (Note: index start from 0, so column2 
>> got index=1)
>>
>> *Row - Col*
>> 0      -  1
>> 0      -  2
>> 1      -  1
>> 1      -  2
>> 2      -  2
>>
>> Clearly, I just want to style 5 cells only. 
>>
>> So i did like you said:
>>
>> in css file:
>>
>> .boldRow .boldColumn { font-weight: bold; }
>>
>> Then in the java file
>>
>> column2.setCellStyleNames(getView().getRes().css().boldColumn());
>> column3.setCellStyleNames(getView().getRes().css().boldColumn());
>>
>>
>> table.setRowStyles(new RowStyles<List<String>>() {
>>    @Override
>>    public String getStyleNames(List<String> row, int rowIndex) {
>>  
>>  
>>       if(rowIndex==0 || rowIndex==1 || rowIndex==2){
>>           return getView().getRes().css().redRow();
>>       }
>>       return null;
>>    }
>>          
>> });
>>
>> ANd here is the result:
>>
>> Col1 - Col2 - Col3
>> 223 - *546* - *698*
>> 123 - *876* - *898*
>> 123 - *896* - *438*
>>
>>
>> Clearly, i don't want this cell (row index =2 & columm index=3) bold. But 
>> the result include it.
>>
>> So how to fix it?
>>
>
> Be creative! Use different row styles, and let's pick meaningful names for 
> them: shouldColumn2BeBold, shouldColumn3BeBold, (applied to rows) and 
> column2 and column3 (applied to columns; I think you could even use a 
> single style name for the columns).
>
> Rows 1 and 2 have shouldColumn2BeBold and shouldColumn3BeBold, row 3 has 
> only shouldColumn3BeBold.
>
> .shouldColumn2BeBold .column2,
> .shouldColumn3BeBold .column3
>  { font-weight: bold; }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to