jquery-stickytable

WebJar for jquery-stickytable

Лицензия

Лицензия

MIT
Категории

Категории

Github Инструменты разработки Контроль версий
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-jpchip-stickytable
Последняя версия

Последняя версия

3.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

jquery-stickytable
WebJar for jquery-stickytable
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jpchip/stickytable

Скачать github-com-jpchip-stickytable

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-jpchip-stickytable/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-jpchip-stickytable</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jpchip-stickytable/
implementation 'org.webjars.npm:github-com-jpchip-stickytable:3.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jpchip-stickytable/
implementation ("org.webjars.npm:github-com-jpchip-stickytable:3.0.0")
'org.webjars.npm:github-com-jpchip-stickytable:jar:3.0.0'
<dependency org="org.webjars.npm" name="github-com-jpchip-stickytable" rev="3.0.0">
  <artifact name="github-com-jpchip-stickytable" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-jpchip-stickytable', version='3.0.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-jpchip-stickytable" % "3.0.0"
[org.webjars.npm/github-com-jpchip-stickytable "3.0.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

jQuery Sticky Table Headers

Make your table headers sticky

This is a version of the sticky table code originally written by Terry Munn, wrapped in a jquery plugin to make it more reusable. I also added some new options and functions.

Installing / Getting started

Install via NPM:

npm install --save jquery-stickytable 

Include jQuery(>=1.12.4) and jquery-stickytable in your head:

<script src="path/to/jquery.js"></script>
<script src="path/to/jquery-stickytable.min.js"></script>

and the css:

<link rel="stylesheet" type="text/css" href="path/to/jquery-stickytable.css">

Files can be found in dist folder:

dist/
├── jquery-stickytable.css
├── jquery-stickytable.js        (UMD)
├── jquery-stickytable.min.js    (UMD, compressed)
└── jquery-stickytable.esm.js    (ES Module, includes css)

Usage

Load stickyTable on your table:

$('#myTable').stickyTable(options);

By default just the header of the table (eg. the thead) is sticky. Biaxial headers are possible — this is for situations where both horizontal and vertical headers are needed. To enable, just wrap the first element in each tbody row in a th instead of a td:

  <tbody>
    <tr>
      <th>Sticky column</th>
      <td>value A</td>
      <td>value B</td>
      ...
    </tr>
    ...
  </tbody>

Options

Option Description
copyTableClass When true copies any classes on the target table to the sticky table. Default is true.
copyEvents When true copies any events on the target table to the sticky table. An example would be if there was a click event on a th element in the thead to do sorting, this would carry over to the sticky column header th. Default is false.
overflowy When true adds an overflow-y class to the sticky table wrapper (ie. sticky-wrap class). This means the table will scroll vertically and only be as tall as it's parent div (see .sticky-wrap.overflow-y in css). Default is false.

Methods

Methods cannot be called until the stickyTable plugin has been initialized on the element.

destroy

Completely removes sticky table classes and elements and destroys the instance.

  $('#myTable').stickyTable('destroy');

Styles

The sticky headers have default colors set, but you can override this css:

.sticky-wrap .sticky-intersect th {
    background-color: #666;
    color: #eee;
}

.sticky-wrap th {
	background-color: #666;
	color: #eee;
}

Exceptions

  • If target element is not a table.
  • If plugin has not been initialised when calling a method
  • If method is private
  • If method does not exist

Source

Версии библиотеки

Версия
3.0.0