Is it possible to have multiple rows with jsf h:datatable

前端 未结 3 1127
难免孤独
难免孤独 2020-12-18 12:35

With h:datatable we can display data as follows

  1. Jems
  2. tom
  3. chirs
  4. harry

but can I display the same as shown below:

3条回答
  •  温柔的废话
    2020-12-18 13:21

    You can use t:dataTable component that support "newspaperColumns" and "newspaperOrientation" attributes. newspaperColumns determine the number of columns the table will be divided over and newspaperOrientation the orientation of the newspaper columns in the newspaper table.

    In your example, the bean:

    public class Bean {
        public List getPeople() {
            List people = new ArrayList();
            people.add("Jems");
            people.add("tom");
            people.add("chirs");
            people.add("harry");
            return people;
        }
    }
    

    And JSF:

    
        
            
        
        
            
        
    
    

    Render as:

    1Jems2tom
    3chirs4harry

提交回复
热议问题