Share via


WebGrid.Table Method

Definition

Returns the HTML markup that is used to render the WebGrid instance.

public System.Web.IHtmlString Table (string tableStyle = default, string headerStyle = default, string footerStyle = default, string rowStyle = default, string alternatingRowStyle = default, string selectedRowStyle = default, string caption = default, bool displayHeader = true, bool fillEmptyRows = false, string emptyRowCellValue = default, System.Collections.Generic.IEnumerable<System.Web.Helpers.WebGridColumn> columns = default, System.Collections.Generic.IEnumerable<string> exclusions = default, Func<dynamic,object> footer = default, object htmlAttributes = default);
member this.Table : string * string * string * string * string * string * string * bool * bool * string * seq<System.Web.Helpers.WebGridColumn> * seq<string> * Func<obj, obj> * obj -> System.Web.IHtmlString
Public Function Table (Optional tableStyle As String = null, Optional headerStyle As String = null, Optional footerStyle As String = null, Optional rowStyle As String = null, Optional alternatingRowStyle As String = null, Optional selectedRowStyle As String = null, Optional caption As String = null, Optional displayHeader As Boolean = true, Optional fillEmptyRows As Boolean = false, Optional emptyRowCellValue As String = null, Optional columns As IEnumerable(Of WebGridColumn) = null, Optional exclusions As IEnumerable(Of String) = null, Optional footer As Func(Of Object, Object) = null, Optional htmlAttributes As Object = null) As IHtmlString

Parameters

tableStyle
String

The name of the CSS class that is used to style the whole table.

headerStyle
String

The name of the CSS class that is used to style the table header.

footerStyle
String

The name of the CSS class that is used to style the table footer.

rowStyle
String

The name of the CSS class that is used to style each table row.

alternatingRowStyle
String

The name of the CSS class that is used to style even-numbered table rows.

selectedRowStyle
String

The name of the CSS class that is used use to style the selected table row.

caption
String

The table caption.

displayHeader
Boolean

true to display the table header; otherwise, false. The default is true.

fillEmptyRows
Boolean

true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the emptyRowCellValue parameter.

emptyRowCellValue
String

The text that is used to populate additional rows in the last page when there are insufficient data items to fill the last page. The fillEmptyRows parameter must be set to true to display these additional rows.

columns
IEnumerable<WebGridColumn>

A collection of WebGridColumn instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains.

exclusions
IEnumerable<String>

A collection that contains the names of the data columns to exclude when the grid auto-populates columns.

footer
Func<Object,Object>

A function that returns the HTML markup that is used to render the table footer.

htmlAttributes
Object

An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the WebGrid instance.

Returns

The HTML markup that represents the fully-populated WebGrid instance.

Applies to