Hai i have created dynamic table and column also but
like this-i am writing code
FacesContext facesContext = FacesContext.getCurrentInstance();
Table table = new Table();
table.setId("table1");
table.setTitle("Dynamically Created Table");
// Create the Table Row group dynamically
TableRowGroup rowGroup = new TableRowGroup();
rowGroup.setId("rowGroup1");
rowGroup.setSourceVar("currentRow");
rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{JSP$AcademicPerformance$EnterMarksStudentSectionwise.tab_section_enrollmentDataProvider2}"));
Integer x=(Integer)getSessionBean1().getStuIdList().size();
rowGroup.setRows(x);
// Add the table row group to the table as a child
table.getChildren().add(rowGroup);
// Create the first table Column
TableColumn tableColumn1 = new TableColumn();
tableColumn1.setId("tableColumn1");
tableColumn1.setHeaderText("Roll No");
// Add the first table Column to the table row group
rowGroup.getChildren().add(tableColumn1);
// Create the Static text and set its value as TRIPID
StaticText staticText1 = new StaticText();
staticText1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['SE_ROLL_NO']}",Integer.class));//String.class
// Add the static text to the table column1
tableColumn1.getChildren().add(staticText1);
TableColumn tableColumn2 = new TableColumn();
tableColumn2.setId("tableColumn2");
tableColumn2.setHeaderText("Student Id");
rowGroup.getChildren().add(tableColumn2);
StaticText staticText2 = new StaticText();
staticText2.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['STU_ID']}",Integer.class));//String.class
tableColumn2.getChildren().add(staticText2);
TableColumn tableColumn3 = new TableColumn();
tableColumn3.setId("tableColumn3");
tableColumn3.setHeaderText("Student Name");
rowGroup.getChildren().add(tableColumn3);
StaticText staticText3 = new StaticText();
staticText3.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['SE_REMARKS']}",String.class));//String.class
tableColumn3.getChildren().add(staticText3);