• Stars
    star
    189
  • Rank 203,914 (Top 5 %)
  • Language
    JavaScript
  • Created almost 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌈 jQuery plugin that makes tables responsive converting them to HTML lists on small viewports.

SWUbanner

jQuery ReStable 0.1.2

jQuery ReStable is a very simple and lightweight (~1Kb) jQuery plugin that make tables responsive making them collapse into ul lists.You can find some examples in the included demo.

To use it you just have to include jQuery and a copy of the plugin in your head or footer:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="jquery.restable.min.js"></script>
<link rel="stylesheet" href="jquery.restable.min.css">

Let's say this is your table:

<table class="mytable">
    <thead>
        <tr>
            <td>Period</td>
            <td>Full Board</td>
            <td>Half Board</td>
            <td>Bed and Breakfast</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>01/10/12 - 02/10/12</td>
            <td>20 €</td>
            <td>30 €</td>
            <td>40 €</td>
        </tr>
        <tr>
            <td>03/10/12 - 04/10/12</td>
           <td>40 €</td>
            <td>50 €</td>
            <td>60 €</td>
        </tr>
        <tr>
            <td>05/10/12 - 06/10/12</td>
            <td>70 €</td>
            <td>80 €</td>
            <td>90 €</td>
        </tr>
    </tbody>
</table>

Now the only thing to do is to trigger the action with:

$(document).ready(function () {
    $.ReStable();
});

This will target automatically all the tables in the page but you can, off course, target one or more elements with:

$(document).ready(function () {
    $('.mytable').ReStable();
});

If you need more control here's the plugin settings:

$('.mytable').ReStable({
    rowHeaders: true, // Table has row headers?
    maxWidth: 480, // Size to which the table become responsive
    keepHtml: false // Keep the html content of cells
});

Credits and contacts

ReStable has been made by me. You can contact me at [email protected] or twitter for any issue or feature request.

More Repositories

1

fontIconPicker

🌈 jQuery fontIconPicker v2 is a small (3.22kb gzipped) jQuery plugin which allows you to include a simple icon picker with search and pagination inside your administration forms.
HTML
267
star
2

editTable

jQuery editTable is a very small jQuery Plugin (~1Kb gzipped) that fill the gap left by the missing of a default input field for data tables.
JavaScript
154
star
3

Nuwk

Nuwk! makes it easy to create Mac Applications based on node-webkit, simplifying testing and building procedures. It takes care of creating the executable, attaching the app icon and configuring the plist file accordingly.
JavaScript
106
star
4

mailamie

🌈 Mailamie is a simple SMTP catch all server for testing written in PHP.
PHP
77
star
5

ReSmenu

jQuery ReSmenu - Select based responsive menu
JavaScript
64
star
6

wp-heartbeat-notify

Based on WordPress 3.6 heartbeat API, Wp Hearbeat Notify, display a realtime custom message to your visitor each time a new post is published with a link redirecting to it. Still in beta version, this plugin has been full tested only on WordPress 3.6-beta3.
PHP
50
star
7

acf-fonticonpicker

ACF { fontIconPicker is a Fonts Icons Picker field type for the Advanced Custom Fields WordPress plugin.
HTML
47
star
8

cookie-notice-js

Vanilla JS that seamlessly add a notice for the European Cookie Law to any website
JavaScript
46
star
9

Twitter-API-1.1-Client-for-Wordpress

A simple class to query Twitter API v1.1 from WordPress with caching
PHP
38
star
10

rooles

A very simple package to handle Roles and Permissions in Laravel 5.1
PHP
11
star
11

WpDevTool

Development tools for WordPress
PHP
5
star
12

Cocoon

WordPress plugin that provides a Laravel like framework
PHP
2
star
13

lazyResp

jQuery plugin to lazy load responsive images with retina support
JavaScript
2
star
14

PostmanCanFail

Notice via mail() or Rollbar in case of WordPress Postman SMTP Mailer sending errors. Postman logging must be enabled.
PHP
2
star
15

email-extract

Extracts all email addresses from a given file and saves them in a new text file.
JavaScript
2
star