1.5.3 • Published 8 years ago

fixed-table-js v1.5.3

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

Fixed Table JS

FixedTableJS - Fixed Table Layout JavaScript Library

GitHub version npm version

npm.io

これは何?

tableレイアウトで、タイトル項目のカラムを簡単に固定表示を行える、JavaScriptライブラリです。

demo

デモページ

Support Browsers

Mac

npm.ionpm.ionpm.ionpm.io
52.0.2743.82 ~47.0.1 ~9.1.2 ~39.0 ~

Windows

npm.ionpm.ionpm.ionpm.ionpm.io
52.0.2743.116 m ~48.0.1 ~1125.10586.0.039.0 ~

Quick start

Clone the repo:

git clone git@github.com:webcyou/fixed-table-js.git

Install with Bower:

bower install fixed-table.js

Install with npm:

npm install fixed-table-js

Basic Usage

<script src="fixed_table.js"></script>

it's a standard table layout.

HTML

<div id="fixedTable">
    <table>
        <thead>....</thead>
        <tbody>
            <tr>
                <th>...</th> or <td>...</td>
                ....
            </tr>
        </tbody>
    </table>
</div>

<thead></thead>と、<tbody><tr></tr></tbody>の最初の子要素が固定されます。

Singleton Object

new FixedTable();

npm.io

argument

new FixedTable(option);

Table Box Full Mode

new FixedTable({ fullMode: true; });

npm.io

Option Parameters Reference

ParametersNametypeDefaultValueDetails
idstring'fixedTable'CSS ID Name
fullModebooleanfalsewindow full size
clickbooleanfalseclick event callBack Function

Public Function

Function NameArgumentArgument TypeDetails
changeModetrue, falsebooleanテーブル表示モード切り替え
setCellStylecell style dataobjectcellのstyleを切り替え
clickcallbackFunctionclick event callBack Function

CallBack Function

fixedTable.click(function(cell: Cell) {
  ...
});

CallBack Parameters Reference

Cell example

Cell {
  id: 14,
  x: 2,
  y: 0,
  width: 228,
  height: 40,
  outerHeight: 57,
  outerWidth: 245,
  borderBottomWidth: "0px",
  borderLeftWidth: "1px",
  borderRightWidth: "0px",
  borderTopWidth: "1px",
  paddingBottom: "8px",
  paddingLeft: "8px",
  paddingRight: "8px",
  paddingTop: "8px",
  parent: "tbody",
  tHeadCell: Cell,
  tagName: "TD",
  isFixed: false,
  boxSizing: "content-box"
}
Parameters NameTypeDetails
idnumbercell ID Number
xnumberx-coordinate
ynumbery-coordinate
widthnumbercontents inner width
heightnumbercontents inner height
outerWidthnumbercontents inner outerWidth
outerHeightnumbercontents inner outerHeight
borderTopWidthstringcontents border top width
borderRightWidthstringcontents border right width
borderBottomWidthstringcontents border bottom width
borderLeftWidthstringcontents border left width
paddingTopstringcontents padding top
paddingRightstringcontents padding right
paddingBottomstringcontents padding bottom
paddingLeftstringcontents padding left
parentstringcontents parent node(tbody or thead)
tHeadCellCellcontents thead cell node
tagNamestringself tagName
isFixedbooleanself fixed style
boxSizingstringboxSizing style

Start develop

npm install
gulp 
Server started http://localhost:8088
LiveReload started on port 35729

Start Test

mocha

npm run test

mocha watch

npm run test:watch

Author

Daisuke Takayama Web帳

License

Copyright (c) 2016 Daisuke Takayama Released under the MIT license

1.5.3

8 years ago

1.5.2

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.1

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago