Sha256: 3aa78b9c7903b5bf0efb0b9dc75d042cf7a9876781a5ddf992cf473a0364544d

Contents?: true

Size: 1.89 KB

Versions: 7

Compression:

Stored size: 1.89 KB

Contents

Class: HtmlTable.Zebra {#HtmlTable:Zebra}
=========================================

Adds stripes to an instance of HtmlTable.

### Refactors

* [HtmlTable][]


HtmlTable Method: constructor
-----------------------------

### Syntax

	new HtmlTable([table, options]);

### Arguments

1. table - (*mixed*; optional) - a Table DOM element or it's id; if you do not specify one, one will be created.
1. options - (*object*; optional) a key/value set of options.

### Options

* all options defined by [HtmlTable][], plus:
* classZebra - (*string*) the class added to odd numbered rows; defaults to 'table-tr-odd'
* zebra - (*boolean*) if *true* adds the *classZebra* value to odd numbered rows.

### Example

	var myTable = new HtmlTable({
		properties: {
			border: 1,
			cellspacing: 3
		},
		rows: [
			['apple', 'red'],
			['lemon', 'yellow']
		],
		zebra: true
	});
	myTable.inject($('someContainer'));

HtmlTable Method: updateZebras {#HtmlTable:updateZebras}
--------------------------------------------------------

Updates the rows, reapplying the odd class names.

### Syntax

	myHtmlTable.updateZebras();


### Returns

* (*object*) an object containing the tr and td tags.

### Example of Object Returned

	{tr: theTableRow, tds: [td, td, td]}

HtmlTable method: empty {#HtmlTable:empty}
------------------------------------------

Empties the *tbody* of the table.

### Syntax

	myTable.empty();

### Returns

* (*object*) This instance of HtmlTable.

HtmlTable method: setHeaders {#HtmlTable:setHeaders}
----------------------------------------------------

Sets the contents of the *thead* with *th* tags.

### Syntax

	myTable.setHeaders(headers);

### Arguments

1. headers - (*array*) an array of header information; same as the row data sent to [HtmlTable.push][]

### Returns

* (*object*) This instance of HtmlTable.

[HtmlTable]: /more/Interface/HtmlTable
[HtmlTable.push]: /more/Interface/HtmlTable#HtmlTable:push

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lsd_rails-0.1.6 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md
lsd_rails-0.1.5 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md
lsd_rails-0.1.4 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md
lsd_rails-0.1.3 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md
lsd_rails-0.1.2 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md
lsd_rails-0.1.1 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md
lsd_rails-0.1 Packages/mootools-more/Docs/Interface/HtmlTable.Zebra.md