Skip to content

aigzhep/table-minimizer

Repository files navigation

minTable

ENG:

Requirements

It's neccessary to use jQuery version 1.6.0 and higher

Description

This plugin allows to minimize a long table down to integer row number and to get short table view without any partial view of the last row. To make a short-view of a table, you need to apply minimize() function to your table(-s):

$(<identifier>).minimize({
min: 0,
buttonText: ["Show", "Hide"],
fixHeader: false,
initialView: "short"
});

Parameters of the minimize() function

Property Type Default meaning Description
min integer 0 An amount of rows you want to show
buttonText array ["Show", "Hide"] A text inside a control button (the button is created automatically)
initialView string "short" An initial state of your table, short or full
fixHeader boolean false Fixation of <thead> table element, if it exists: true when it's needed to be always fully shown, false when it can be partially hidden

Important. Don't forget to add css-file minTable-base.css into your code: it has basic styles to set more accurate view of final tables.

РУ:

Требования

Необходимо использовать библиотеку jQuery версии 1.6.0 и выше

Описание

Данный плагин позволяет сворачивать длинные таблицы до целого числа строк. При этом в таком свернутом состоянии строки показываются полностью, без "обрезания" последней строки по высоте.
Для этого вам нужно привязать функцию minimize() к вашей(-им) таблице(-ам):

$(<identifier>).minimize({
min: 0,
buttonText: ["Show", "Hide"],
fixHeader: false,
initialView: "short"
});

Параметры функции minimize():

Свойство Тип Значение по умолчанию Описание
min целое число 0 Количество видимых строк
buttonText массив ["Show", "Hide"] Текст внутри кнопки управления (кнопка генерируется автоматически)
initialView строка "short" Начальный вид таблицы, short (свернута) или full(полностью показана)
fixHeader логический false Фиксация элемента <thead> таблицы, если таковой есть: true - он будет видимым всегда, false - строки из него можно будет скрывать.
Важно. Не забудьте подключить в вашем коде css-файл minTable-base.css: в нем прописаны основные стили, которые помогут привести получившиеся таблицы к более аккуратному виду.

About

jQuery plugin,which allows to minimize (collapse, hide) a long table down to integer row number.

Resources

License

Stars

Watchers

Forks

Packages

No packages published