sexy-table
TypeScript icon, indicating that this package has built-in type declarations

0.0.26 • Public • Published

SexyTable

A good looking HTML5 table that's not a table :)

This project is a concept that I will be using in an up coming commercial project that I am involved with. I was looking for a client side component like:

I wanted a table that was sortable, filterable, searchable and pageable. I also had a design to follow that called for various fancy drop shadows, animations and other CSS3 goodies that can not easily be applied to a traditional HTML <table>.

Dynatable was closest to meeting my requirements. See: http://www.dynatable.com/#rendering

However I was already using a client side view framework, Transparency.js And I felt that there was a lot of double up between Dynatable and Transparency. See: http://leonidas.github.io/transparency/

So What Is SexyTable:

It is a table like client side component, built with HTML, CSS & JS.

In actual fact this could be refactored using the new Web Components APIs. However I required IE8+ compatibility and figured Web Components was just too new for my commercial project. See: http://webcomponents.org/

<div class="sexy-table">
    <ul>
        <li>Row 1 : Cell 1</li>
        <li>Row 1 : Cell 2</li>
        <li>Row 1 : Cell 3</li>
    </ul>
    <ul>
        <li>Row 2 : Cell 1</li>
        <li>Row 2 : Cell 2</li>
        <li>Row 2 : Cell 3</li>
    </ul>
</div>

At it's simplest a UL element represents a ROW of the table and an LI element represents a CELL of that ROW.

The advantage is that each CELL is now a block element that we have greater control over with CSS. But because of this we lose the normal built in table sizing functionality thus we use some javascript to explicitly set the height of each row and the width of each cell.

The other features, sorting, searching, filtering and data binding are all built on top of this concept. Please see the examples folder for more info.

Installation:

BOWER:

bower install sexy-table --save

NPM:

npm install sexy-table --save

THEN:

<link rel="stylesheet" href="./dist/SexyTable.css" />
<script src="./dist/SexyTable.js"></script>

NOTE: TypeScript users may also reference the SexyTable.d.ts definitions file.

OR

Make use of the "tsd link" feature. see: https://github.com/Definitelytyped/tsd#link-to-bundled-definitions

Dependencies:

To make use of all of SexyTable's great features there are a number of other third party dependencies. Instead of bundling these with SexyTable and forcing you to include large amounts of potentially unused javascript in your application.

It is up to you to include the packages as you need them:

At a minimum you must include jQuery before SexyTable!

NOTE: All the examples show you exactly what is required.

Building:

If you wish to build SexyTable from the TypeScript/Less sources:

I Confess:

The table has no pre built sexy looking themes. In fact I have purposefully left the styling as basic as possible so that it can easily be overwritten.

In short get YOUR graphic designer to make it look sexy :)


Developed by Brad Jones - brad@bjc.id.au

Package Sidebar

Install

npm i sexy-table

Weekly Downloads

13

Version

0.0.26

License

MIT

Last publish

Collaborators