First, front desk
<asp:table id="tblapprove" runat="server" width= " 100%"></asp:table>
Second, backstage
Queryapproveinfo
Private voidsettable () {TableRow Tblrow=NewTableRow (); TableCell Tblcell=NewTableCell (); Tblcell.text="Approval Information"; TblCell.Font.Size=Ten; TblCell.Font.Bold=true; Tblcell.forecolor=System.Drawing.Color.Green; TBLROW.CELLS.ADD (Tblcell); Tblcell=NewTableCell (); Tblcell.text="Approving person"; TBLROW.CELLS.ADD (Tblcell); TextBox Tbox=NewTextBox (); ObjectCode = session["Login.wname"]; Tbox.text=code. ToString (); Tbox.readonly=true; Tblcell=NewTableCell (); TBLCELL.CONTROLS.ADD (Tbox); TBLROW.CELLS.ADD (Tblcell); TBLAPPROVE.ROWS.ADD (Tblrow); Tblcell=NewTableCell (); Tblcell.text="Approval Date"; TBLROW.CELLS.ADD (Tblcell); Tbox=NewTextBox (); Tbox.text=System.DateTime.Now.ToShortDateString (); Tbox.readonly=true; Tblcell=NewTableCell (); //tblcell.width=100;TblCell.Controls.Add (Tbox); TBLROW.CELLS.ADD (Tblcell); TBLAPPROVE.ROWS.ADD (Tblrow); Tblrow=NewTableRow (); Tblcell=NewTableCell (); Tbox=NewTextBox (); Tbox.cssclass="Multtextbox"; Tbox.id="Opinion"; Tbox.textmode=System.Web.UI.WebControls.TextBoxMode.MultiLine; TBLCELL.CONTROLS.ADD (Tbox); Tblcell.columnspan=5; TBLROW.CELLS.ADD (Tblcell); TBLAPPROVE.ROWS.ADD (Tblrow); /*Table T1=new table (); T1. Cssclass= "TblStyle2"; Row=new TableRow (); C1=new TableCell (); C1. text= "Approving person"; Row. Cells.add (C1); C1=new TableCell (); C1. text= "Approval Date"; Row. Cells.add (C1); C1=new TableCell (); C1. text= "Approval Date"; Row. Cells.add (C1); C1=new TableCell (); C1. text= "Approving person"; Row. Cells.add (C1); T1. Rows.Add (row); Row=new TableRow (); C1=new TableCell (); C1. Controls.Add (t1); C1. Cssclass= "TblStyle2"; Row. Cells.add (C1); TBLAPPROVE.ROWS.ADD (row); */ }
Dynamically add Table table contents to populate approval comments.