Name
Table
Synopsis
This class provides a powerful object model for creating HTML tables. It is similar
to, but more abstract than, the System.Web.UI.HtmlControls.HtmlTable
class. It also allows ASP.NET
to optimize rendering for both down-level and up-level browsers. You can use it to
dynamically generate an HTML table by adding TableRow
objects to the Rows
collection and adding TableCell
objects to each row. Note that
if you create or modify a table’s structure programmatically, these changes will not
be preserved across postbacks and you will have to reconstruct them manually; table rows and cells are controls of their own, not properties of Table
.
Most other properties for the Table
class correspond to formatting
options, including a background image
(BackImageUrl
), alignment
(HorizontalAlign
), gridlines
(GridLines
), the spacing between
cells (CellSpacing
), and the
spacing between cell borders and content
(CellPadding
).
This class is often used by control developers, while the DataGrid
and DataList
controls are preferred for
ASP.NET applications, particularly if data binding is required.
Public Class Table : Inherits WebControl ' Public Constructors Public Sub New() ' Public Instance Properties Overridable Public Property BackImageUrl As String Overridable Public Property CellPadding As Integer Overridable Public Property CellSpacing As Integer Overridable Public Property GridLines As GridLines Overridable Public Property HorizontalAlign As HorizontalAlign Overridable Public ...
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.