Giter Site home page Giter Site logo

quanganhcnt50 / rwd-table-patterns Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nadangergeo/rwd-table-patterns

0.0 2.0 0.0 4.96 MB

This is an experimental awesome solution for responsive tables with complex data.

Home Page: http://gergeo.se/RWD-Table-Patterns/

License: MIT License

rwd-table-patterns's Introduction

RWD-Table-Patterns

This is an experimental awesome solution for responsive tables with complex data. It's a fork based on Filament Group's repo with a more complete solutions and some new features.

Demo:

For demo: http://gergeo.se/RWD-Table-Patterns/

Features:

####Made for Twitter Bootstrap

Designed to be used with Bootstrap 3. If you don't want to use bootstrap, just fork the repo and customize it to your needs!

####Mobile first

Built with mobile first in mind. As a bonus, the tables won't break on old browsers :)

####Graceful JS fallback

In browsers without JavaScript, the tables will still be scrollable. I.e. there's still some responsiveness.

####Easy to use

You only need to include one JS-file, one CSS-file and one line of JavaScript and your tables are responsive.

Dependencies: jQuery and Twitter Bootstrap 3.

How to use:

####0. Protip: Install using Bower

bower install RWD-Table-Patterns

####1. Add CSS file to the <head>

<link rel="stylesheet" href="css/rwd-table.min.css">

####2. Add JavaScript either to the <head>, or to the bottom of <body>

<script type="text/javascript" src="js/rwd-table.js"></script>
<script>
   $(function() {
      $('.table-complex').responsiveTable({
        adddisplayallbtn: true,
        addfocusbtn: true,
        fixednavbar: '#navbar'//In case you have a fixed navbar.
      })
   });
</script>

#####You also need to add the dependencies

  • jQuery (>=1.11.0)
  • Twitter Bootstrap 3 (>=3.1.1)

####3. HTML Classes For better IE support, you need to have IE classes. Replace <html> with:

<!--[if lt IE 7 ]> <html lang="en" class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js lt-ie10"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->

####4. Markup Add the classes .table, .table-complex to the tables and wrap them in .table-responsive You also need to give the table a unique id.

The table is also compatible with Twitter Bootstrap's .table-striped and .table-bordered classes.

<div class="table-responsive">
   <table id="example-table" class="table table-complex table-bordered table-striped">
      ...
   </table>
</div>

####5. Setup your table with data-priority attributes for each <th>

Attribute Description/Breakpoint
data-priority="" Always visible and not hideable from dropdown
data-priority="1" Always visible (but hidable from dropdown)
data-priority="2" Visible when (min-width: 480px)
data-priority="3" (min-width: 640px)
data-priority="4" (min-width: 800px)
data-priority="5" (min-width: 960px)
data-priority="6" (min-width: 1120px)

rwd-table-patterns's People

Contributors

nadangergeo avatar wnr avatar

Watchers

James Cloos avatar nguyen quang anh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.