Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Table within Cell
Message
From
20/05/2014 15:44:10
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Create Table within Cell
Environment versions
Environment:
ASP.NET
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600342
Message ID:
01600342
Views:
33
This is C#, by the way

I need to be able to create a table of tables.
I can do it 'by hand' in HTML
        asp:Table ID="ServerTable" runat="server" Width="100%"  Height="100%" CellSpacing="20" >
           asp:TableRow>
               asp:TableCell>
                  asp:Table CssClass="HeatTableGreen" ID="Table2" runat="server" Height="100%" width="100%"  >
                    asp:TableRow>
                        asp:TableCell CssClass="HeatInfoCell" ID="SvrName1" HorizontalAlign="Center" >
                            label>1</label>
                        /asp:TableCell>
                        asp:TableCell >
                        /asp:TableCell>
                        asp:TableCell  >
                        /asp:TableCell>
                    /asp:TableRow>   

                    asp:TableRow>
                        asp:TableCell  >
                        /asp:TableCell>
                        asp:TableCell CssClass="HeatInfoCell"  ID="SvrCount1" HorizontalAlign="Center" >
                            <label>15</label> 
                        /asp:TableCell>
                        asp:TableCell  >
                        /asp:TableCell>
                    /asp:TableRow>     
                  /asp:Table>  
                /asp:TableCell>
     etc
     etc...
There are 9 total of these in a 3x3 table and I think (note the hopeful use of that word) I've got the C# code
           var HeatTable = new Table();
            
            
            if ((i % 2) == 0)
            {
                HeatTable.CssClass = ".HeatTableGreen";
            }
            else
            {
                HeatTable.CssClass = ".HeatTableYellow";
            }
            HeatTable.ID = "HeatTable" + i.ToString();
            for (int k = 0; k < 2; k++)    //Row counter in HeatTable
            {
                var HeatRow = new TableRow();
                for (int j = 0; j < 3; j++)     //Col counter in HeatTable
                {
                    var HeatCell = new TableCell();
                    switch (k)
                    {
                        case 0:
                            if (j == 0)
                            {
                                //this is a HeatInfo cell
                                HeatCell.Text = "1";  //replace with ServerName from table
                                HeatCell.CssClass = ".HeatInfo";
                            }
                            break;
                        case 1:
                            if (j == 1)
                            {
                                //the other HeatInfo cell
                                HeatCell.Text = "22";  //replace with CurrentTotalTasks
                                HeatCell.CssClass = ".HeatInfo";
                            }
                            break;
                        default:
                            HeatCell.CssClass = "HeatCell";
                            break;
                    } //HeatCell
                    HeatRow.Cells.Add(HeatCell);
                }  //HeatRow
                HeatTable.Rows.Add(HeatRow);
            } //HeatTable
        }
        HeatFrameRow.Cells.Add(HeatFrameCell);
        HeatFrame.Rows.Add(HeatFrameRow);
But I have no flailing idea how to get this to show up on the page. When I run it, I get a blank page
in the aspx I now have
  div id="HTDIv">
    asp:Table ID="HeatFrame" runat="server" GridLines="Both" >
  /div
What am I not doing?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Next
Reply
Map
View

Click here to load this message in the networking platform