Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstein committed Feb 9, 2012
1 parent bc92f26 commit 6cc18c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -51,7 +51,7 @@ The following are all examples of using both the column selector and extension f
// select the cells in the 9th, 19th, 29th, etc, column of #mytable
$('#mytable td:nth-col(10n-1)');

More examples are available on a separate page which shows [examples of column selectors](examples.html) used with tables containing complicated column and row spans.
More examples are available on a separate page which shows [examples of column selectors](examples/examples.html) used with tables containing complicated column and row spans.

## Frequently Asked Questions

Expand All @@ -65,15 +65,15 @@ The selector engine will first select all `td` elements in your document and pas

Q: Why not just use col and colgroup?

A: There are several reasons you might want to use this plugin over `col` and `colgroup` . First, [col and colgroup are restricted in the CSS attributes they support](http://www.w3.org/TR/CSS21/tables.html#columns) , which may be problematic if you want to do advanced styling. They are limited because `col` and `colgroup` define artificial elements that are not actually there in the source document. This plugin on the other hand returns the actual table cells that make up the column. These cells can then be styled in any way. Second, browser support for those `col` and `colgroup` attributes that can be styled is [problematic](http://www.quirksmode.org/css/columns.html), while all browsers fully support styling table cells.
A: There are several reasons you might want to use this plugin over `col` and `colgroup` . First, [col and colgroup are restricted in the CSS attributes they support](http://www.w3.org/TR/CSS21/tables.html#columns), which may be problematic if you want to do advanced styling. They are limited because `col` and `colgroup` define artificial elements that are not actually there in the source document. This plugin on the other hand returns the actual table cells that make up the column. These cells can then be styled in any way. Second, browser support for those `col` and `colgroup` attributes that can be styled is [problematic](http://www.quirksmode.org/css/columns.html), while all browsers fully support styling table cells.

Q: What is the difference between using this plugin and using the standard `#mytable tbody > td:nth-child(n)` selector?

A: For tables that have no row or column span attributes this works just fine, and is the recommended method if you know for sure your tables will never contain a row or column span. If you have row or column spans in your table, or at least the possibility that they might one day be there, you should use the column selector plugin which handles column and row spans correctly.

## Credits

The algorithm used in the column selector was inspired by the work done by [Matt Kruse of The Javascript Toolbox](http://www.javascripttoolbox.com/) .
The algorithm used in the column selector was inspired by the work done by [Matt Kruse of The Javascript Toolbox](http://www.javascripttoolbox.com/).

## Alternatives
* [jQuery column iterator](http://slackers.se/2009/jquery-column-iterator-plugin/)

0 comments on commit 6cc18c2

Please sign in to comment.