This documentation is archived and is not being maintained.

TableStyle Class

Represents the style for a table control. This class is primarily used by control developers.

For a list of all members of this type, see TableStyle Members.


[Visual Basic]
Public Class TableStyle
   Inherits Style
public class TableStyle : Style
public __gc class TableStyle : public Style
public class TableStyle extends Style

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The TableStyle class is used to represent the style for a table control. It encapsulates the properties that control the appearance of a table and can be applied to multiple table controls to provide a common appearance.

You can specify an image to display in the background of the table by setting the BackImageUrl property. The amount of spacing between the cells of a table is controlled by the CellSpacing property. The spacing between the contents of a cell and the cell border is specified using the CellPadding property. You can specify whether cell borders are displayed by setting the GridLines property. The horizontal alignment of the table in relation to other elements on the Web Forms page is indicated by the HorizontalAlign property.

Note   This class is primarily used by control developers.


Namespace: System.Web.UI.WebControls

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)

See Also

TableStyle Members | System.Web.UI.WebControls Namespace | BackImageUrl | CellSpacing | CellPadding | GridLines | HorizontalAlign