• The eternal confessions of a beautiful mind...
  • DamianM.Co.UK
  • Home
  • About
  • Archives
  • Contact
  • Sitemap
  • My Flickr

    IMG_9585IMG_9115IMG_9113IMG_9111IMG_9078IMG_9075IMG_9069IMG_9065IMG_9041IMG_9032IMG_8963IMG_8928IMG_8916IMG_8915IMG_8904IMG_8876IMG_8858IMG_8830IMG_8828IMG_8826

  • Recent Posts

    • Excuse my French
    • A good catholic lightswitch
    • What they would look like if they weren’t famous!!
    • Funniest Valedictorian Speech Ever
    • Can you spot the bands?
    • Strictly for the office
    • Failing the exam with dignity
    • New Ohio Roller Coaster - INSANE!!!
    • Speeding
    • Captions not required
    • Unfortunate Backgrounds
    • Unfortunate Signs
    • OMG!!
    • Women as explained by engineer
    • The Monty Hall Problem
  • My Tools

    • Blog_LinkIt
    • DCoda Theme
    • DCoda Widgets
    • RSS_Sticky
    • WordPress.org
    • WP_BlogNetworking
    • WP_BoilerPlate
    • WP_Censor
    • WP_ContactMe
    • WP_DeliciousPost
    • WP_EasyReply
    • WP_HeadNFoot
    • WP_LinkIt
    • WP_LinkSync
    • WP_OneInstall
    • WP_PostDate
    • WP_PostNotes
    • WP_RssSticky
    • WP_Spoiler
    • WP_Submission
  • My Web

    • ASPAlliance
    • ClaimID
    • del.ico.us
    • Digg
    • DSLRBlog
    • DVDProfiler
    • Flickr
    • Honeyed SPAM
    • My Blog
    • My company
    • MYSpace
    • WordPress.org
    • YouTube

    Table Code

    Table.aspx

    1
    2
    3
    4
    5
    6
    
    <%@ Control Language="vb" AutoEventWireup="false" Codebehind="table.aspx.vb" Inherits="DamianM.Table1" %>
    <%@ Register TagPrefix="cc1" Namespace="DamianM" Assembly="DamianM" %>
    <center>
    	<Table id="Table1" runat="server">
    	</Table>
    </center>

    Table.aspx.vb

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    
    Public Class Table1
        Inherits System.Web.UI.UserControl
        Protected WithEvents Table1 As System.Web.UI.HtmlControls.HtmlTable
     
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'declare holders for the rows and cells you are going to create
            Dim r As System.Web.UI.HtmlControls.HtmlTableRow
            Dim c As System.Web.UI.HtmlControls.HtmlTableCell
     
            'all the tables attribute are available to be set
            'through the tables object
            Table1.Border = 1
            Table1.Width = "50%"
     
            'creare a new row
            r = New System.Web.UI.HtmlControls.HtmlTableRow()
            'create a new cell
            c = New System.Web.UI.HtmlControls.HtmlTableCell()
     
            'all the cells attribute are available to be set
            'through the tables object
            c.ColSpan = 2
            c.Align = "center"
            c.BgColor = "silver"
            c.InnerText = "Server Created Table"
     
            'add the new cell to the row
            r.Cells.Add(c)
     
            'add the new row to the table
            Table1.Rows.Add(r)
     
            'a loop to create a sample table
            Dim i As Integer
            For i = 0 To 10
                r = New System.Web.UI.HtmlControls.HtmlTableRow()
     
                'all the rows attribute are available to be set
                'through the tables object
                r.BgColor = &H999999 + (i * 1024) ' set the color to something
     
                c = New System.Web.UI.HtmlControls.HtmlTableCell()
                c.InnerText = i.ToString
                r.Cells.Add(c)
                c = New System.Web.UI.HtmlControls.HtmlTableCell()
                c.InnerText = "this is row " + i.ToString
                r.Cells.Add(c)
                Table1.Rows.Add(r)
            Next
     
        End Sub
     
        Private Sub InitializeComponent()
     
        End Sub
    End Class

    Leave a Reply

    Related Posts from the Past:

    • NewTable Code
    • Email
    • Tip : Formatting USB Flash Drives and Memory Cards with NTFS
    • "I'm BATMAN"
    • Scraping in one line using temporary objects code