# Class: HTMLColumn

## FooTable.HTMLColumn

#### new HTMLColumn(instance, definition) → {FooTable.HTMLColumn}

The HTML column class is used to handle any raw HTML columns.

##### Parameters:

Name | Type | Description
--- | --- | ---
`instance` | FooTable.Table | The parent `FooTable.Table` this column belongs to.
`definition` | object | An object containing all the properties to set for the column.

##### Returns:

Type
  FooTable.HTMLColumn

### Extends

- FooTable.Column

### Members

#### (readonly) $el :jQuery

The jQuery cell object for the column header.

##### Type:

- jQuery

Inherited From:
  - FooTable.Column#$el

#### classes :Array.<string>

The classes to apply to all cells in this column.

##### Type:

- Array.<string>

Inherited From:
  - FooTable.Column#classes

#### (readonly) ft :FooTable.Table

The root `FooTable.Table` for the column.

##### Type:

- FooTable.Table

Inherited From:
  - FooTable.Column#ft

#### hidden :boolean

Whether or not this column is hidden from view and appears in the details row.

##### Type:

- boolean

Inherited From:
  - FooTable.Column#hidden
Default Value:
  - false

#### (readonly) index :number

The index of the column in the table. This is set by the plugin during initialization.

##### Type:

- number

Inherited From:
  - FooTable.Column#index
Default Value:
  - -1

#### name :string

The name of the column. This name must correspond to the property name of the JSON row data.

##### Type:

- string

Inherited From:
  - FooTable.Column#name
Default Value:
  - null

#### style :object

The styles to apply to all cells in this column.

##### Type:

- object

Inherited From:
  - FooTable.Column#style

#### title :string

The title to display in the column header, this can be HTML.

##### Type:

- string

Inherited From:
  - FooTable.Column#title
Default Value:
  - null

#### (readonly) type :string

The type of data displayed by the column.

##### Type:

- string

Inherited From:
  - FooTable.Column#type

#### (readonly) virtual :boolean

Whether or not the column was parsed from a standard table row containing data instead of from an actual header row.

##### Type:

- boolean

Inherited From:
  - FooTable.Column#virtual

#### visible :boolean

Whether or not this column is completely hidden from view and will not appear in the details row.

##### Type:

- boolean

Inherited From:
  - FooTable.Column#visible
Default Value:
  - true

### Methods

#### (protected) $create()

After the column has been defined this ensures that the $el property is a jQuery object by either creating or updating the current value.

##### This:

- FooTable.Column

Inherited From:
  - FooTable.Column#$create

#### (protected) createCell(row) → {FooTable.Cell}

Creates a cell for this column from the supplied `FooTable.Row` object. This allows different column types to return different types of cells.

##### This:

- FooTable.Column

##### Parameters:

Name | Type | Description
--- | --- | ---
`row` | FooTable.Row | The row to create the cell from.

Inherited From:
  - FooTable.Column#createCell

##### Returns:

Type
  FooTable.Cell

#### (protected) define(definition)

This is supplied the column definition in the form of a simple object created by merging options supplied via the plugin constructor with those parsed from the DOM.

##### This:

- FooTable.Column

##### Parameters:

Name | Type | Description
--- | --- | ---
`definition` | object | The object containing the column definition.

Inherited From:
  - FooTable.Column#define

#### (protected) formatter(value) → {string|HTMLElement|jQuery}

This is supplied the value retrieved from the `FooTable.Column#parse` function and must return a string, HTMLElement or jQuery object. The return value from this function is what is displayed in the cell in the table.

##### This:

- FooTable.Column

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | string | The value to format.

Inherited From:
  - FooTable.Column#formatter

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) parser(valueOrElement) → {number|null}

This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the `FooTable.HTMLColumn#format` function to generate the cell contents.

##### This:

- FooTable.HTMLColumn

##### Parameters:

Name | Type | Description
--- | --- | ---
`valueOrElement` | * | jQuery | The value or jQuery cell object.

Overrides:
  - FooTable.Column#parser

##### Returns:

Type
  number | null