Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Creating a dynamic HTML table in a visual webpart issue?

$
0
0
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];
                   
                   
                    tr.Cells.Add(td);
                    tb.Rows.Add(tr);
 
 
                }
 

            }

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.

 


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>