title: How to add CSS stylesheet to aspx.vb table
body: <p>I have created a search button that when clicked it will display the details of the search into a table format but i need help in getting the table to look like a table and look presentable.</p>
  
  <p>i'm struggling to work out how i go about this as im new to asp.net. I do have a stylesheet linked to my .aspx page and this is my OnCLick event handler code;</p>
  
  <pre><code> Protected Sub SearchButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles     SearchButton.Click
      Dim dsResults As New DataSet
      Dim dt As DataTableReader
  
  
  
      dsResults = SearchResults(sbox1.Text)
      dt = dsResults.CreateDataReader
  
  
      Dim tb As New Table
      Dim tr As New TableRow
      Dim tc As New TableCell
      Dim lb As New Label
  
      tb.Attributes.Add("class", "tableClass")
      tr.Attributes.Add("class", "tableRowClass")
  
      If dt.HasRows = True Then
          Do While dt.Read
  
              tr = New TableRow
              tc = New TableCell
              lb = New Label
  
              lb.Text = dt.Item("name").ToString()
              tc.Controls.Add(lb)
              tr.Controls.Add(tc)
              tb.Controls.Add(tr)
  
  
  
              tc = New TableCell
              lb = New Label
  
              lb.Text = dt.Item("age").ToString()
              tc.Controls.Add(lb)
              tr.Controls.Add(tc)
  
              tb.Controls.Add(tr)
  
  
  
              tc = New TableCell
              lb = New Label
  
              lb.Text = dt.Item("sex").ToString()
              tc.Controls.Add(lb)
              tr.Controls.Add(tc)
  
              tb.Controls.Add(tr)
  
  
  
              tc = New TableCell
              lb = New Label
  
              lb.Text = dt.Item("department").ToString()
              tc.Controls.Add(lb)
              tr.Controls.Add(tc)
  
              tb.Controls.Add(tr)
  
  
  
              tc = New TableCell
              lb = New Label
  
              lb.Text = dt.Item("list_group").ToString()
              tc.Controls.Add(lb)
              tr.Controls.Add(tc)
  
              tb.Controls.Add(tr)
  
  
  
              tc = New TableCell
              lb = New Label
  
              lb.Text = dt.Item("date_added").ToString()
              tc.Controls.Add(lb)
              tr.Controls.Add(tc)
  
              tb.Controls.Add(tr)
          Loop
          dt.Close()
          dsResults.Dispose()
  
          placeResults.Controls.Add(tb)
  
      Else
  
          noResultOutput.Text = "No Results Matched Your Search"
  
      End If
  End Sub
  End Class
  </code></pre>
  
  <p>Can someone please help me in how i can add a class or something to link to my stylesheet so my table looks good. I have attempted to add a class above but nothing happens if i add this to my stylesheet.</p>
  
  <p>Thank You.</p>