how to generate an html table and add it into a panel.

hi experts,
i have a panel called pInci,

i'd like to add it a complete table generated by a controller with the method GetAlgo_Inci();
i wonder what 's the best maner? with literal controls or with htmltable?

this is how i'd like to add my new generated table.

how would be my method GetAlgo_Inci()? what do i have to return if i want to use
html controls in order to add the complete HtmlTable to Controls of my Panel ?

Class Controller
public .....  GetAlgo_Inci(){                   <-  what type to return,
    Table t = new Table();
    HtmlTableRow tr = new ...
    ...................                                      <- add tr to t?  

how you see what i need experts.
thanks in advance.
Who is Participating?
rallsaldoConnect With a Mentor Commented:

You could use System.Web.UI.WebControls and the return a Table object:

public Table GetAlgo_Inci()
        Table t = new Table();
        TableRow tr = new TableRow();
        TableCell tc = new TableCell();
        return t;

Then you can add the returned table to your panel:

Table t = new Table();
t = Controller.GetAlgo_Inci();

I hope that helps,
nisarkhanConnect With a Mentor Commented:
or the easiest  and  also easy to maintain option is:

public String GetAlgo_Inci()
        return "<table width='100%'><tr><td>something</tr></td>";
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.