Solved

ASP.NET thead create table with thead using code behind

Posted on 2013-02-01
2
1,918 Views
Last Modified: 2013-02-04
using my existing code below how can i incorp thead

<table><thead><tr><td></td></tr></table>

 
Dim c As New TableCell
            Dim r As New TableRow
            Dim D As New TableRow

 c = New TableCell
                c.Text = "te"
                r.Style.Add("text-align", "center")
                c.Style.Add("width", "70px")
                c.Style.Add("border-bottom", "black 1px solid")
                r.Cells.Add(c)

                c = New TableCell
                c.Text = "Item"
                r.Style.Add("text-align", "center")
                c.Style.Add("width", "40px")
                c.Style.Add("border-bottom", "black 1px solid")
                'c.ColumnSpan = 3
                r.Cells.Add(c)
 Trade.Rows.Add(r)

Open in new window

0
Comment
Question by:sevensnake77
2 Comments
 
LVL 6

Accepted Solution

by:
esolve earned 500 total points
ID: 38846296
Look at this:

http://www.thebestdata.com/zoom.htm?menutype=1&auto=2362
http://forums.asp.net/t/1182775.aspx/1
TableRow row = new TableHeaderRow();
        TableRow row2 = new TableRow();
        TableRow row3 = new TableFooterRow();
        Table table = new Table();

        var cell1 = new TableCell();
        row.TableSection = TableRowSection.TableHeader;
        cell1.Text = "Header";
        row.Cells.Add(cell1);

        var cell2 = new TableCell();
        cell2.Text = "Contents";
        row2.Cells.Add(cell2);

        var cell3 = new TableCell();
        cell3.Text = "Footer";
        row3.Cells.Add(cell3);
        row3.TableSection = TableRowSection.TableFooter;


        table.Rows.Add(row);
        table.Rows.Add(row2);
        table.Rows.Add(row3);
        this.Controls.Add(table);

Open in new window

0
 
LVL 9

Author Closing Comment

by:sevensnake77
ID: 38851577
tks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question