System.Web.UI.WebControls.TableCell Class

Represents a cell in a System.Web.UI.WebControls.Table control.

See Also: TableCell Members

Syntax

[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.PreviewControlDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.Bindable(false)]
[System.ComponentModel.ToolboxItem("")]
[System.Web.UI.ParseChildren(false)]
[System.ComponentModel.DefaultProperty("Text")]
[System.Web.UI.ControlBuilder(typeof(System.Web.UI.WebControls.TableCellControlBuilder))]
public class TableCell : WebControl

Remarks

In this topic:

Introduction

The System.Web.UI.WebControls.TableCell class represents a cell in a System.Web.UI.WebControls.Table control. You can use the TableCell.Text property to specify or determine the contents of the cell.

The System.Web.UI.WebControls.TableCell class allows you to control how the contents of the cell are displayed. The alignment of the contents in the cell are specified by setting the TableCell.HorizontalAlign and TableCell.VerticalAlign properties. You can use the TableCell.Wrap property to specify whether the contents of the cell wrap in the cell.

You can also specify how many rows or columns in the table, represented by a System.Web.UI.WebControls.Table control, are occupied by an individual cell. The TableCell.RowSpan and TableCell.ColumnSpan properties control how many rows and columns are used, respectively.

Note:

This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. Validation server controls are also provided to assess user input. For more information, see Securing Standard ControlsHow to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings, and Introduction to Validating User Input in ASP.NET Web Pages.

Declarative Syntax

Example

<asp:TableCell
    AccessKey="string"
    AssociatedHeaderCellID="string"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0