Creating a dynamic HTML table in a visual webpart issue?


  • I am trying to create a dynamic HTML table with each row having different <td> width,Below is the code in which i am giving dyanmic width for each <td> .

    for (int i = 1; i < 6; i++)

                    if (options[i] != string.Empty)
                        TableRow trnew TableRow();
                        TableCell td = new TableCell();
                        td.Width = responses[i, 1];
                        td.Height = 12;
                        td.BackColor = colors[i];
                        td.BorderColor = colors[i];


    But i am getting 4 rows with same width.I could see width values are different but table is getting created as below with same width.Any pointers why its taking same width.Whats the way to make it different widths thats being applied dynamically.


    Friday, December 06, 2013 4:52 PM


All replies