{"id":18389567,"url":"https://github.com/anseki/jquery-gettable","last_synced_at":"2025-10-13T23:20:06.330Z","repository":{"id":20687718,"uuid":"23970927","full_name":"anseki/jquery-gettable","owner":"anseki","description":"The simple jQuery Plugin for easy getting the table cells that are positioned on the horizontal line, the vertical line or both lines that pass through the target cell.","archived":false,"fork":false,"pushed_at":"2022-08-19T03:18:55.000Z","size":564,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-19T17:39:38.122Z","etag":null,"topics":["cell","column","cross","extended-cells","header","horizontal","html","javascript","jquery-plugin","parsing","row","table","td","tr","vertical"],"latest_commit_sha":null,"homepage":"http://anseki.github.io/jquery-gettable/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anseki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-12T17:56:53.000Z","updated_at":"2024-09-11T19:31:37.000Z","dependencies_parsed_at":"2022-08-05T09:15:30.795Z","dependency_job_id":null,"html_url":"https://github.com/anseki/jquery-gettable","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/anseki/jquery-gettable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fjquery-gettable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fjquery-gettable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fjquery-gettable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fjquery-gettable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anseki","download_url":"https://codeload.github.com/anseki/jquery-gettable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fjquery-gettable/sbom","scorecard":{"id":198005,"data":{"date":"2025-08-11","repo":{"name":"github.com/anseki/jquery-gettable","commit":"3249021f009a15d0df53b3f2fa48c812d1756638"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T22:11:24.276Z","repository_id":20687718,"created_at":"2025-08-16T22:11:24.276Z","updated_at":"2025-08-16T22:11:24.276Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017243,"owners_count":26086014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cell","column","cross","extended-cells","header","horizontal","html","javascript","jquery-plugin","parsing","row","table","td","tr","vertical"],"created_at":"2024-11-06T01:43:45.184Z","updated_at":"2025-10-13T23:20:06.314Z","avatar_url":"https://github.com/anseki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getTable\n\n[![npm](https://img.shields.io/npm/v/jquery-gettable.svg)](https://www.npmjs.com/package/jquery-gettable) [![GitHub issues](https://img.shields.io/github/issues/anseki/jquery-gettable.svg)](https://github.com/anseki/jquery-gettable/issues) [![David](https://img.shields.io/david/anseki/jquery-gettable.svg)](package.json) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThe simple jQuery Plugin for easy getting the table cells that are positioned on the horizontal line, the vertical line or both lines that pass through the target cell.\n\n[![ss-01](ss-01.gif)](https://anseki.github.io/jquery-gettable/)  \n[![ss-02](ss-02.gif)](https://anseki.github.io/jquery-gettable/)\n\n**See \u003ca href=\"https://anseki.github.io/jquery-gettable/\"\u003eDEMO\u003c/a\u003e**\n\n+ getTable gets the horizontal line (`row`) and the vertical line (`col`) of the table. And it gets cells that are positioned on those lines. The handling cells that are positioned on the horizontal line is supported by `\u003ctr\u003e` HTML tag, but the vertical line is not supported by the HTML.\n+ The cells that are extended by `colspan`/`rowspan` are parsed correctly. More lines pass through the extended cells (i.e. those cells catch more cells), and those cells are positioned on more lines (i.e. those cells are caught by more cells).\n+ The horizontal line (`row`) and the vertical line (`col`) are discerned. getTable returns a jQuery object (or Array of those), therefore you can do anything you want to those.\n+ The table is parsed via DOM, it's fast, correctly, and those data are cached.\n\n```js\n// Get rows that include target cell.\nrows = $('td#target').getTable('rows');\n\n// Get cols that include target cell.\ncols = $('td#target').getTable('cols');\n\n// Get cells that are included in the cross line (rows and cols) of target cell.\n// And style those.\ncells = $('td#target').getTable('xCells').css('backgroundColor', 'blue');\n```\n\n## Getting Started\nLoad after jQuery.\n\n```html\n\u003cscript src=\"jquery-1.11.0.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.gettable.min.js\"\u003e\u003c/script\u003e\n```\n\n## Methods\n\n### `rows`\n\n```js\nrows = target.getTable('rows')\n```\n\nReturn an Array that includes zero or more `row`s. The `row` is a jQuery object that includes zero or more `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) elements that are positioned on a horizontal line. The `cell`s in the `row` are sorted by position as from left to right, regardless of the HTML source order. For example, `row.eq(0)` is leftmost `cell` like the header.  \n*(If you want to do something to all `cell`s in `rows` together (you want to do nothing to each `row`), use [`rowsCells`](#rowscells) method.)*  \nThe elements are selected according to the each element that is included in current target jQuery object. The returned `rows` is one Array that includes all of those.\n\nAn element that is included in current target jQuery object is:\n\n+ **`table`** (`\u003ctable\u003e` element)  \ne.g. `$('table#target').getTable('rows')`  \nAll `row`s in this `table` are selected.\n+ **`row`** (`\u003ctr\u003e` element)  \ne.g. `$('tr#target').getTable('rows')`  \nThis `row` itself is selected.  \nThe `cell` elements in this `row` are not the same as `cell` elements in `\u003ctr\u003e` element, which includes `cell`s that are extended by `rowspan` in previous `\u003ctr\u003e`.\n+ **`cell`** (`\u003ctd\u003e` or `\u003cth\u003e` element)  \ne.g. `$('td#target').getTable('rows')`  \nAll `row`s that include this `cell` (i.e. horizontal lines that pass through this `cell`) are selected.  \n*(If you want both `rows` and `cols` of `cell`, use [`xCells`](#xcells) method.)*  \nFor example:\n\n```js\nvar hl; // keep to restore\n$('td').hover(function() {\n  hl = $(this).getTable('rows')[0].addClass('highlight');\n}, function() {\n  hl.removeClass('highlight');\n});\n```\n\n+ **`section`** (`\u003cthead\u003e`, `\u003ctfoot\u003e` or `\u003ctbody\u003e` element)  \ne.g. `$('thead#target').getTable('rows')`  \nAll `row`s in this `section` are selected.\n\nIn any cases, the nested `table` (`table` that is included in current target) is excluded (If part of the nested `table` is target too, of course it is included).\n\n### `rowsCells`\n\n```js\ncells = target.getTable('rowsCells')\n```\n\nReturn a jQuery object that includes zero or more `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) elements that are included in all `row`s that selected by same way as [`rows`](#rows) method. The returned `cells` is one jQuery object that includes all of those.  \n*(If you want to do something to each `row` (you want to do nothing to all `cell`s in `rows` together), use [`rows`](#rows) method.)*\n\nThis is not the same as merged all `cell`s that are returned by [`rows`](#rows) method, `rowsCells` method returns unique `cell`s, duplicated elements are excluded.\n\n### `cols`\n\n```js\ncols = target.getTable('cols')\n```\n\nReturn an Array that includes zero or more `col`s. The `col` is a jQuery object that includes zero or more `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) elements that are positioned on a vertical line. The `cell`s in the `col` are sorted by position as from top to bottom, regardless of the HTML source order. For example, `col.eq(0)` is uppermost `cell` like the header.  \n*(If you want to do something to all `cell`s in `cols` together (you want to do nothing to each `col`), use [`colsCells`](#colscells) method.)*  \nThe elements are selected according to the each element that is included in current target jQuery object. The returned `cols` is one Array that includes all of those.\n\nAn element that is included in current target jQuery object is:\n\n+ **`table`, `row`, `section`** (`\u003ctable\u003e`, `\u003ctr\u003e`, `\u003cthead\u003e`, `\u003ctfoot\u003e` or `\u003ctbody\u003e` element)  \ne.g. `$('thead#target').getTable('cols')`  \nAll `col`s in this `table` are selected.\n+ **`cell`** (`\u003ctd\u003e` or `\u003cth\u003e` element)  \ne.g. `$('td#target').getTable('cols')`  \nAll `col`s that include this `cell` (i.e. vertical lines that pass through this `cell`) are selected.  \n*(If you want both `rows` and `cols` of `cell`, use [`xCells`](#xcells) method.)*  \nFor example:\n\n```js\nvar hl; // keep to restore\n$('td').hover(function() {\n  hl = $(this).getTable('cols')[0].addClass('highlight');\n}, function() {\n  hl.removeClass('highlight');\n});\n```\n\nIn any cases, the nested `table` (`table` that is included in current target) is excluded (If part of the nested `table` is target too, of course it is included).\n\n### `colsCells`\n\n```js\ncells = target.getTable('colsCells')\n```\n\nReturn a jQuery object that includes zero or more `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) elements that are included in all `col`s that selected by same way as [`cols`](#cols) method. The returned `cells` is one jQuery object that includes all of those.  \n*(If you want to do something to each `col` (you want to do nothing to all `cell`s in `cols` together), use [`cols`](#cols) method.)*\n\nThis is not the same as merged all `cell`s that are returned by [`cols`](#cols) method, `colsCells` method returns unique `cell`s, duplicated elements are excluded.\n\n### `cells`\n\n```js\ncells = target.getTable('cells')\n```\n\nReturn a jQuery object that includes zero or more `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) elements. The elements are selected according to the each element that is included in current target jQuery object. The returned `cells` is one jQuery object that includes all of those.\n\nAn element that is included in current target jQuery object is:\n\n+ **`table`** (`\u003ctable\u003e` element)  \ne.g. `$('table#target').getTable('cells')`  \nAll `cell`s in this `table` are selected.\n+ **`row`** (`\u003ctr\u003e` element)  \ne.g. `$('tr#target').getTable('cells')`  \nAll `cell`s in this `row` are selected.  \nThis is not the same as `cell` elements in `\u003ctr\u003e` element, which includes `cell`s that are extended by `rowspan` in previous `\u003ctr\u003e`.  \nFor example:\n\n```js\n$('#targetRow').getTable('cells').css('backgroundColor', 'blue');\n```\n\n+ **`cell`** (`\u003ctd\u003e` or `\u003cth\u003e` element)  \ne.g. `$('td#target').getTable('cells')`  \nThis `cell` itself is selected.\n+ **`section`** (`\u003cthead\u003e`, `\u003ctfoot\u003e` or `\u003ctbody\u003e` element)  \ne.g. `$('thead#target').getTable('cells')`  \nAll `cell`s in this `section` are selected.\n\nIn any cases, the nested `table` (`table` that is included in current target) is excluded (If part of the nested `table` is target too, of course it is included).\n\n### `xCells`\n\n```js\ncells = target.getTable('xCells')\n```\n\nReturn a jQuery object that includes zero or more `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) elements that are positioned on the cross line (horizontal line and vertical line) that pass through the each element that is included in current target jQuery object. The returned `cells` is one jQuery object that includes all of those. The first `cell` of that `cells` is current target. i.e. `cells.eq(0)` is a `cell` on the cross point.  \nThe elements that are not `cell` (`\u003ctd\u003e` or `\u003cth\u003e`) are ignored.\n\nThis is not the same as merged all `cell`s that are returned by [`rows`](#rows) method and [`cols`](#cols) method, `xCells` method returns unique `cell`s, duplicated elements are excluded.\n\nThe nested `table` (`table` that is included in current target) is excluded (If part of the nested `table` is target too, of course it is included).\n\nFor example:\n\n```js\nvar hl; // keep to restore\n$('td').hover(function() {\n  hl = $(this).getTable('xCells').addClass('highlight');\n}, function() {\n  hl.removeClass('highlight');\n});\n```\n\n### `table`\n\n```js\ntable = target.getTable('table')\n```\n\nReturn a jQuery object that includes zero or more `table` (`\u003ctable\u003e`) elements. The `\u003ctable\u003e` elements that are included in current target jQuery object, and the `\u003ctable\u003e` elements that have `\u003ctr\u003e`, `\u003ctd\u003e`, `\u003cth\u003e`, `\u003cthead\u003e`, `\u003ctfoot\u003e` or `\u003ctbody\u003e` elements that are included in current target jQuery object are selected. The returned `table` is one jQuery object that includes all of those (duplicated elements are excluded).\n\n### Initialize\n\n```js\ntarget.getTable()\n```\n\nParse the table, and cache those data.  \nYou usually don't need to call initialize method, because getTable parses it automatically when getTable met the unknown table via other methods. And getTable caches those data, therefore parsing again is not needed.  \nThe cases of initialize method is needed are:\n\n+ You want to make preparations in advance.\n+ You changed the structure of the table that was already parsed.\n\nIf the element that is included in current target jQuery object is `\u003ctable\u003e`, that table is parsed. If the element is part of the table (`\u003ctr\u003e`, `\u003ctd\u003e`, `\u003cth\u003e`, `\u003cthead\u003e`, `\u003ctfoot\u003e` or `\u003ctbody\u003e`), the table that has those parts is parsed.  \ni.e. these codes below are equals:\n\n```js\n$('table#table1').getTable();\n$('table#table1\u003etbody:eq(0)').getTable();\n$('table#table1\u003etbody:eq(0)\u003etr:eq(0)').getTable();\n$('table#table1\u003etbody:eq(0)\u003etr:eq(0)\u003etd:eq(0)').getTable();\n```\n\ngetTable discern the nested table correctly, therefore if `\u003ctd\u003e` of only the inner table is given, the outer table is not parsed.\n\n## Note\n\nThe cell extending by `colspan=\"0\"` and `\u003ccolgroup\u003e` is not supported. Now, the browser that supports this is Firefox only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fjquery-gettable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanseki%2Fjquery-gettable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fjquery-gettable/lists"}