# fixed-table

> Vanilla JS table with fixed header row and leftmost column

Latest version **1.0.0** (published 2018-06-11) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install fixed-table
pnpm add fixed-table
yarn add fixed-table
bun add fixed-table
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-06-11 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | https://github.com/kevkan |
| Maintainers | lokidokicoki |

## Links

- npm: https://www.npmjs.com/package/fixed-table
- Repository: https://github.com/mtechaccess/fixed-table
- Homepage: https://github.com/mtechaccess/fixed-table#readme
- Issues: https://github.com/mtechaccess/fixed-table/issues
- npm.io page: https://npm.io/package/fixed-table

## Recent versions

- 1.0.0 (latest) — 2018-06-11

## README

# fixed-table
A simple HTML and JS table with a fixed header row and a fixed leftmost column. The approach is taken from [Fixed Tables JS](https://github.com/webcyou/fixed-table-js).

## Features
- Uses standard html table markup — no extra elements or classes needed. The only requirement is that the table is inside an element with class `fixed-table-container`.
- Uses vanilla JavaScript, so there's no dependencies.
- When users resize the browser window, column widths are updated using the default HTML table layout algorithm.

## Limitations
- Cell heights are incorrect when a row contains cells of varying heights. To avoid this, do not wrap cell content (e.g., by using `white-space: nowrap !important;`). Avoid long content in the fixed column so that it doesn't overwhelm narrow viewports.

## Usage
```
// Initialize table
var myFixedTable = fixTable(document.getElementById('my-fixed-table-container'));

// Programatically re-layout the table (e.g., after changing the number of columns, or changing content)
myFixedTable.relayout();
```

---
_Source: https://npm.io/package/fixed-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
