Code Monkey home page Code Monkey logo

tablesaw's Introduction

⚠️ This project is archived and the repository is no longer maintained.

Tablesaw

npm version Build Status Dependency Status

Filament Group

A set of plugins for responsive tables.

Roadmap and Enhancement Queue

This repository is now using lodash style issue management for enhancements. This means enhancement issues will be closed instead of leaving them open.

Stack Mode

The Stack Table stacks the table headers to a two column layout with headers on the left when the viewport width is less than 40em (640px).

<table class="tablesaw tablesaw-stack" data-tablesaw-mode="stack">

If you only want to use the Stack Table and don’t want all the extra features below (save yourself some bytes), Tablesaw provides a Stack-Only version.

Option Description
Opt out of inline labels To opt-out of inline label creation (the table header cell text that shows at small breakpoints) on a per-table basis, use <table data-tablesaw-no-labels>; on a per-row basis, use <tr data-tablesaw-no-labels>; on a per-cell basis, use <td data-tablesaw-no-labels> (added in v3.1.0)
Hide headers for empty body cells When the table cell is empty, use <table data-tablesaw-hide-empty> to hide the header when stacked.

Column Toggle Mode

The Column Toggle Table allows the user to select which columns they want to be visible.

<table data-tablesaw-mode="columntoggle">
Option Description
Add a Mini-Map The little dots that appear next to the column toggle popup. Use the data-tablesaw-minimap attribute: <table data-tablesaw-mode="columntoggle" data-tablesaw-minimap>

The user always has the option to select all columns. If the table gets too wide for the viewport, it can overflow and cause a page-level scrollbar. To combat this issue, we recommend wrapping your table in a <div class="tablesaw-overflow"> element to restrict scrolling to the table-only. The toggle demo has one such example.

Advanced Option: Prioritize Columns

Table headers must have a data-tablesaw-priority attribute to be eligible to toggle. data-tablesaw-priority is a numeric value from 1 to 6, which determine default breakpoints at which a column will show. The breakpoint defaults are:

<th data-tablesaw-priority="persist"><!-- Not eligible for toggle, always shows --></th>
<th data-tablesaw-priority="0"><!-- Hidden at all breakpoints by default, must be toggled back on manually --></th>
<th data-tablesaw-priority="1"><!-- Shows at (min-width: 20em) (320px) --></th>
<th data-tablesaw-priority="2"><!-- Shows at (min-width: 30em) (480px) --></th>
<th data-tablesaw-priority="3"><!-- Shows at (min-width: 40em) (640px) --></th>
<th data-tablesaw-priority="4"><!-- Shows at (min-width: 50em) (800px) --></th>
<th data-tablesaw-priority="5"><!-- Shows at (min-width: 60em) (960px) --></th>
<th data-tablesaw-priority="6"><!-- Shows at (min-width: 70em) (1120px) --></th>

Keep in mind that the priorities are not exclusive—multiple columns can reuse the same priority value.

Swipe Mode

Allows the user to use the swipe gesture (or use the left and right buttons) to navigate the columns.

<table data-tablesaw-mode="swipe">
Options Description
Persist a Column Columns also respect the data-tablesaw-priority="persist" attribute: <th data-tablesaw-priority="persist"><!-- Always shows --></th>
Add a Mini-Map The little dots that appear next to the column navigation buttons. Use the data-tablesaw-minimap attribute: <table data-tablesaw-mode="swipe" data-tablesaw-minimap>
All columns visible class Tablesaw also exposes a tablesaw-all-cols-visible class that is toggled on when all of the table columns are visible (and off when not). You can use this in CSS to hide the minimap or navigation buttons if needed.
Disable swipe touch events Use the <table data-tablesaw-no-touch> attribute to opt-out of swiping left or right to navigate columns. Users will need to use the provided buttons instead.
Advanced Option: Configure Swipe Thresholds

Add a TablesawConfig object to your page in a <script> element. It doesn’t matter if it’s declared before or after the Tablesaw JavaScript.

<script>
TablesawConfig = {
  swipeHorizontalThreshold: 15,
  swipeVerticalThreshold: 20
};
</script>

Mini Map

Use data-tablesaw-minimap to add a series of small dots to show which columns are currently visible and which are hidden. Only available on swipe and columntoggle tables. Examples available above.

Mode Switcher

<table data-tablesaw-mode-switch>

<!-- With a different default mode -->
<table data-tablesaw-mode-switch data-tablesaw-mode="swipe">

<!-- Exclude a mode from the switcher -->
<table data-tablesaw-mode-switch data-tablesaw-mode-exclude="columntoggle">

Sortable

The “sortable” option allows the user to sort the table data by clicking on the table headers. Since all the columns may not be visible on smaller breakpoints (or not there at all if using the “stack” table mode), relying solely on the column headers to choose the table sort isn’t practical. To address this, there is an optional data-tablesaw-sortable-switch attribute on the table that adds a select menu auto-populated with the names of each column in the table with options for choosing ascending or descending sort direction. Data options on table headers can be used to control which columns are sortable (data-tablesaw-sortable-col) and the default sort order (data-tablesaw-sortable-default-col).

<table data-tablesaw-sortable>
    <thead>
        <tr>
            <!-- Default column -->
            <th data-tablesaw-sortable-col data-tablesaw-sortable-default-col>Rank</th>
            <th data-tablesaw-sortable-col>Movie Title</th>
            <th data-tablesaw-sortable-col data-tablesaw-sortable-numeric>Year</th>
            <th data-tablesaw-sortable-col data-tablesaw-sortable-numeric><abbr title="Rotten Tomato Rating">Rating</abbr></th>
            <!-- Unsortable column -->
            <th>Reviews</th>
        </tr>
    </thead>
    ...

Use data-tablesaw-sortable-switch to add a select form element to manually choose the sort order.

<table data-tablesaw-sortable data-tablesaw-sortable-switch>

Advanced Option: Custom Sort Functions

Tablesaw provides two methods of sorting built-in: string and numeric. To use numeric sort, use the data-tablesaw-sortable-numeric class as shown in the above sorting markup example. Otherwise, tablesaw uses a case insensitive string sort.

All other types of sorting must use a Custom Sort function on the individual columns (working example). In the contrived example below, we want to sort full dates (e.g. 12/02/2014) just on the year.

// Add a data function to the table header cell
$( "th#custom-sort" ).data( "tablesaw-sort", function( ascending ) {
    // return a function
    return function( a, b ) {
        // Ignore rows with data-tablesaw-ignorerow (leave them where they were)
        if( a.ignored || b.ignored ) {
            return 0;
        }

        // use a.cell and b.cell for cell values
        var dateA = a.cell.split( "/" ),
            dateB = b.cell.split( "/" ),
            yearA = parseInt( dateA[ 2 ], 10 ),
            yearB = parseInt( dateB[ 2 ], 10 );

        if( ascending ) {
            return yearA >= yearB ? 1 : -1;
        } else { // descending
            return yearA < yearB ? 1 : -1;
        }
    };
});

Kitchen Table Sink

All of the above options combined into a single table.

Check All

Added in 3.0.1. Add the data-tablesaw-checkall to a checkbox in a thead cell to enable that checkbox to toggle the other checkboxes in the same column.

Internationalization i18n

Added in 3.0.2. Use the TablesawConfig global on your page to override internationalization strings. It doesn’t matter if it’s declared before or after the Tablesaw JavaScript library.

<script>
TablesawConfig = {
  i18n: {
    modeStack: 'Stack',
    modeSwipe: 'Swipe',
    modeToggle: 'Toggle',
    modeSwitchColumnsAbbreviated: 'Cols',
    modeSwitchColumns: 'Columns',
    columnToggleButton: 'Columns',
    columnToggleError: 'No eligible columns.',
    sort: 'Sort',
    swipePreviousColumn: 'Previous column',
    swipeNextColumn: 'Next column'
  }
};
</script>

Getting Started

Available through npm:

npm install tablesaw

The Full Tablesaw

Tablesaw (no dependencies)
<link rel="stylesheet" href="tablesaw.css">
<script src="tablesaw.js"></script>
<script src="tablesaw-init.js"></script>
or Tablesaw (jQuery Plugin)
<link rel="stylesheet" href="tablesaw.css">
<!-- load your own jQuery -->
<script src="jquery.js"></script>
<script src="tablesaw.jquery.js"></script>
<script src="tablesaw-init.js"></script>

Don’t forget to add your table markup! For a stack table, this is how it’d look:

<table class="tablesaw tablesaw-stack" data-tablesaw-mode="stack">

The demos above include full markup examples for all of the Tablesaw types.

Manual initialization of Tablesaw Components

If you want to initialize your Tablesaw tables manually, don’t include <script src="tablesaw-init.js"> in your markup. Instead, you can use Tablesaw.init(). This will scan the tree for any Tablesaw tables and initialize them for you.

Tables must be visible for proper initialization.

Tablesaw.init();
Tablesaw.init( myElement ); // OR pass an element to only init within a context

Dynamically Loading Tablesaw

For user interfaces that are dynamically built, Tablesaw can be loaded on an as-needed basis.
Here's how you might do this with jQuery:

$('head').append('<script src="tablesaw.js"></script>');

Following that, tables may be initialized manually as they are created.

Using Stack-Only Tablesaw

As shown above, we provide a Stack-mode-only package of Tablesaw. It’s a barebones version that doesn’t include any of the other features above.

Stack-only Tablesaw (no dependencies)
<link rel="stylesheet" href="tablesaw.css">
<script src="stackonly/tablesaw.stackonly.js"></script>
<script src="tablesaw-init.js"></script>
or just Stack-only Tablesaw (jQuery Plugin)
<link rel="stylesheet" href="tablesaw.css">
<!-- load your own jQuery -->
<script src="jquery.js"></script>
<script src="stackonly/tablesaw.stackonly.jquery.js"></script>
<script src="tablesaw-init.js"></script>

And then:

<table class="tablesaw tablesaw-stack" data-tablesaw-mode="stack">

Using Stack-Only Tablesaw SCSS Mixin

To easily customize the breakpoint at which the stack table switches, use the SCSS mixin. First, include the tablesaw.stackonly.scss file instead of tablesaw.stackonly.css in your SASS. Then, use a parent selector on your table.

<div class="my-parent-selector">
    <table class="tablesaw" data-tablesaw-mode="stack">

Include the mixin like so:

.my-parent-selector {
  @include tablesaw-stack( 50em );
}

The argument to tablesaw-stack is the breakpoint at which the table will switch from columns to stacked.

Default Styles

Starting with Tablesaw 3.0, the “Bare”, or stripped down style version of Tablesaw has been made the default.

Some of the more intrusive default styles have instead moved to opt-in classes you can add to the <table> element:

  • tablesaw-row-border: Adds a bottom border to each table row.
  • tablesaw-row-zebra: Adds a light background color to every other table row.
  • tablesaw-swipe-shadow: Adds the light shadow to the right of persistant columns to make them stand out a little more.

Limitations

  • Simple colspan and rowspan are supported, in part thanks to a lovely PR from @jgibson.
Stack Column Toggle Swipe Sortable
rowspan Not yet supported (#247) Supported Supported Not yet supported (#268)
colspan Supported Supported Supported Supported

Browser Support

All major browsers (evergreens are not listed, but supported). Notably this project cuts the mustard for A-grade support with:

  • Internet Explorer 9+
  • Android Browser 2.3+
  • Blackberry OS 6+

Other legacy browsers and Opera Mini receive unenhanced table markup.

Bundler Compatibility

Building the Project Locally

Run npm install to install dependencies and then grunt to build the project files into the dist folder.

Release Names

Previous versions didn’t have names.

tablesaw's People

Contributors

38elements avatar aakoch avatar dsabados avatar dz avatar emattias avatar geo242 avatar greenkeeperio-bot avatar jefflembeck avatar jgibson avatar jonscottclark avatar nagarajhubli avatar nschonni avatar peterwilsoncc avatar prayagverma avatar relaxatorium avatar smallen13 avatar toddparker avatar tomyouds avatar unrealsolver avatar wilto avatar zachleat avatar zozich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tablesaw's Issues

Dynamically append new rows

Hi,

I'm wondering what is the proper way to add dynamically new rows to a table already instantiated with tablesaw?
If some columns are not displayed like in the example below, added rows doesn't have corresponding cells hidden.
image

I tested your answer on ticket #13 but It doesn't seem to work.

I try also these lines after appending the new rows via ajax, but with no success (mini-map disappear...) :

$( "#items-index-table" ).table( ).data('table').destroy();
$( "#items-index-table" ).table( ).data('table').init();

Any idea ?

HTML stripped from `th`

When <a>s (or <sup> or probably any elements) appear inside a <th>, Tablesaw strips them. This is happening with the table I posted in #48.

Given:

<th colspan="3" rowspan="1">Breast cancer mortality<sup><a class="footnote-ref" href="#fn-iii">iii</a></sup> at mid-range follow-up (6 to 8 years)</th>

I'm getting:

<b class="tablesaw-cell-label tablesaw-cell-label-top">Breast cancer mortalityiii at mid-range follow-up (6 to 8 years)</b>

Instead of:

<b class="tablesaw-cell-label tablesaw-cell-label-top">Breast cancer mortality<sup><a class="footnote-ref" href="#fn-iii">iii</a></sup> at mid-range follow-up (6 to 8 years)</b>

Stacktable - Table Headers not coming along

Hi,

I've been using stack table and so far it looks pretty good. The only issue is that when the screen is shrank, the table headers do not appear in every row - only at the top.

Am I missing something? Sorry for the newbie question!

Thanks,
Alex

Width customization

How to customize the size at which the table is converted to stack. Default is 40em (640px) How to increase say 60em or 900px

data-mode changes cell data type to text

When adding 'data-mode="stack"' to a table, it breaks sorting. Numerical columns which sorted correctly previous now sort Alphabetically, e.g. "1, 100, 2" instead of "1, 2, 100". If I remove the data-mode and leave everything else the same, it works fine.

Any workarounds for this?

Request - Toggle Icon on Sort Tables?

Hi all - my department is using Tablesaw and we LOVE it! I had one quick question/request - is there any plan to add an up/down arrow to the sort table heads? If one already exists and I've missed it, I apologize. Thanks again for creating this - we really love it. :)

Table Headers disappears in small view after navigating to a different page

I am using the tablesaw.stackonly with a MVC application
I have 5 divs in each page and each one have a table saw,
To navigate to the next page I do a Ajax call to my controller and reload the page with the next 5 divs.
The table saw only inits for the first page but after navigating I lose the stacking functionality,
help...?

Separation of presentation styles and behavioral styles

I would like to use the full tablesaw plugin in my project, but there are numerous conflicts with tablesaw styles and the styles of my own project. Things such as:

  • Usage of gradient headers
  • Usage of ems while my project uses rems
  • Padding different than my project defaults

and so on. I can overwrite these things in my own styles as needed, but that creates extra work and potential bugs.

The current defaults for tablesaw make perfect sense to me as a solution for one-stop drop-in table styling and configuration, but it would be wonderful if there was a "tablesaw-bare.css" option or something similar which included the markup needed for javascript behaviors, but not the more presentational markup.

x-editable compatibility

When using both tablesaw swipe with x-editable to edit the fields of the table, it resets to show only the first n columns if i try to edit a field from a cell which is not originally visible, but gets visible after swipe. So that makes it impossible to edit a field in a column not in the first n visible ones.

Fixed table header

To have a fixed table header I added jQuery.floatThread. I added

I added

$(window).trigger('resize')

to the event handler of the column chooser popup checkboxes and changed the

z-index: 999

for the popup.

Perhaps some documentation and testing would be great so people can see how to have fixed headers.

Toggling hidden column in swipe mode not persisting

On resizing browser window, cant hide columns (after inspecting element, table seems to be applying a class 'tablesaw-fix-persist', then seems to be removed). Tried upgrading to different versions of tablesaw, so I guess its a common problem

screenshot from 2014-08-13 12 22 48

Sorting - Case Sensitive

Great work! One issue I had is the sorting is case sensitive. If you have the following items and are sorting from Z-A it shows as:

  1. berry
  2. Tomato
  3. Apple
  4. Apple

Ajax TBODY question

I have a problem, insert tbody tag with jquery. html () the data that the server sends me. but the effects are not activated. could help me please?
excuse my English, I speak Spanish.


sin ajax
data devuelta

con ajax

Customer Nombre Registrado Nombre R.Civil/SRI %Coin Ced/RUC Ciudad Teléfono Contact Retenido Dirección Agencia Vendedor
011116TORRES ROSALES JORGE TORRES ROSALES JORGE PAUL100 1712521945001QUITO999999999VENDEDOR AG QUITONMERCADO GRAN COLOMBIA PTO 93OF. QUEVEDO AGENCIA QUEVEDO
0000003ACERO MOROCHO MARGARITA ACERO MOROCHO MARGARITA FRANCISCA100 0906539515GUAYAQUILDESPENSA NUESTRA SEÑORA DEL CISNEYLA CH 708 E/ 36 Y 37COELLO JULIO AGENCIA GUAYAQUIL

Sync across multiple tables

I have a sports result website, where each category from the race is shown in a separate table, one underneath another.

What I'd love would be to use the columntoggle functionality on the top table, and have any changes then mirror onto all of the other tables.

I've played around with the code, but it's beyond my JS/jquery skill level.

Thanks

Initiate Tablesaw explicitly

I am trying to use Tablesaw in a single page application (in my case, using Ember). Table in my application is not loaded from the beginning, it loads when user goes to one of the link.
I went through the whole documentation, but could not find a way to initiate tablesaw explicitly(when table loads). Can you, please tell me the way to do that?

Assign a number of Column per screen size

Hello, your plugin is very helpful for us, however we can't seem find a solution to our problem.
Here's our table http://www.webiii.dk/cu on the Select Type View dropdown, select Map View, you'll notice that we have a 8 columns not including the persist column. We are using a swipe function, now we want to to show 4 columns on desktop, 2 on tablet then 1 on mobile at a time. How we can do that? Thanks.

Swipe doesn't Swipe

I've been using this plugin and love the flexibility but can't seem to get the swipe gesture to work in any browser. Even using the demo link to swipe, I can't seem to get a swipe gesture to work on chrome desktop / android or the native android browser.

In the README.MD I see:

Allows the user to use the swipe gesture (or use the left and right buttons) to navigate the columns.

Does this require a third party library?

Sort plugin - jQuery-ui conflict

The data attribute used for the sort function is in conflict with jQuery-ui (sortable).

Use different name like data-sortablesaw must fix that.

Using tablesaw on nested tables also runs on parent tables

I've got a situation where a parent table only has two columns and is ok on mobile as-is. It contains a nested table, however, which needs tablesaw with stack mode. When adding class="tablesaw tablesaw-stack" data-mode="stack" on the nested table, the parent also receives a tablesaw-stack, affecting the styiling when it doesn't need any.

If you need more details or an example snippet, let me know.

Changing breakpoint at which table toggle happens

Hey, thanks for the great plugin, good job!
I was wondering whether there is a configuration or some easy way to adjust at which breakpoint the toggle of table happens? The table on my project table is too wide for current breakpoint and starts to look terrible before the toggle happens.

complex tables

I'm trying to use the stack-only version on a complex table that uses multiple header rows, with cells having varying colspans and rowspans, and it's getting a little wonky.

My table:

<figure id="table3">
    <table class="tablesaw tablesaw-stack" data-mode="stack">
        <caption>Table 3: Summary of Evidence—Mammography Trials for Women Younger than 50 Years—Breast Cancer Mortality</caption>
        <thead>
            <tr>
                <th colspan="1" rowspan="2">Study</th>
                <th colspan="1" rowspan="2">Age at entry (years)</th>
                <th colspan="1" rowspan="2">Screening interval (months)</th>
                <th colspan="1" rowspan="2">Year study began</th>
                <th colspan="2" rowspan="1">Total study sample size</th>
                <th colspan="3" rowspan="1">Breast cancer mortality<sup><a class="footnote-ref" href="#fn-iii">iii</a></sup> at mid-range follow-up (6 to 8 years)</th>
                <th colspan="3" rowspan="1">Breast cancer mortality<sup><a class="footnote-ref" href="#fn-iii">iii</a></sup> at 14-year follow-up</th>
            </tr>
            <tr>
                <th>Study group</th>
                <th>Control group</th>
                <th>Study group</th>
                <th>Control group</th>
                <th>RR (95% CI)</th>
                <th>Study group</th>
                <th>Control group</th>
                <th>RR (95% CI)</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>HIP<sup><a class="footnote-ref" href="#fn-66">66</a></sup></td>
                <td>40–49</td>
                <td>12</td>
                <td>1963</td>
                <td>13,740</td>
                <td>13,740</td>
                <td>19</td>
                <td>20</td>
                <td>0.95 (0.51–1.78)</td>
                <td>64</td>
                <td>82</td>
                <td>0.78 (0.56–1.08)</td>
            </tr>
            <tr>
                <td>Malmö<sup><a class="footnote-ref" href="#fn-58">58</a></sup></td>
                <td>45–54</td>
                <td>18–24</td>
                <td>1976</td>
                <td>13,568</td>
                <td>12,279</td>
                <td>N/A</td>
                <td>N/A</td>
                <td>N/A</td>
                <td>53</td>
                <td>66</td>
                <td>0.73 (0.51–1.04)</td>
            </tr>
            <tr>
                <td>Östergötland (E-County)<sup><a class="footnote-ref" href="#fn-65">65</a></sup></td>
                <td>40–49</td>
                <td>24</td>
                <td>1977</td>
                <td>10,285</td>
                <td>10,459</td>
                <td>15</td>
                <td>15</td>
                <td>1.03 (0.50–2.11)</td>
                <td>31</td>
                <td>30</td>
                <td>1.05 (0.64–1.73)</td>
            </tr>
            <tr>
                <td>Kopparberg (W-County)<sup><a class="footnote-ref" href="#fn-65">65</a></sup></td>
                <td>40–49</td>
                <td>24</td>
                <td>1977</td>
                <td>9,582</td>
                <td>5,031</td>
                <td>13</td>
                <td>9</td>
                <td>0.76 (0.32–1.77)</td>
                <td>22</td>
                <td>16</td>
                <td>0.72 (0.38–1.37)</td>
            </tr>
            <tr>
                <td>CNBSS-1<sup><a class="footnote-ref" href="#fn-56">56</a></sup></td>
                <td>40–49</td>
                <td>12</td>
                <td>1980</td>
                <td>25,214</td>
                <td>25,216</td>
                <td>38</td>
                <td>28</td>
                <td>1.36 (0.84–2.21)</td>
                <td>105</td>
                <td>108</td>
                <td>0.97 (0.74–1.27)</td>
            </tr>
            <tr>
                <td>Stockholm<sup><a class="footnote-ref" href="#fn-64">64</a></sup></td>
                <td>40–49</td>
                <td>28</td>
                <td>1981</td>
                <td>14,303</td>
                <td>8,021</td>
                <td>16</td>
                <td>8</td>
                <td>1.09 (0.40–3.00)</td>
                <td>34</td>
                <td>13</td>
                <td>1.47 (0.77–2.78)</td>
            </tr>
            <tr>
                <td>Göteborg<sup><a class="footnote-ref" href="#fn-63">63</a></sup></td>
                <td>39–49</td>
                <td>18</td>
                <td>1982</td>
                <td>11,724</td>
                <td>14,217</td>
                <td>16</td>
                <td>33</td>
                <td>0.59 (0.33–1.06)</td>
                <td>34</td>
                <td>59</td>
                <td>0.70 (0.46–1.06)</td>
            </tr>
            <tr>
                <td>UK AGE<sup><a class="footnote-ref" href="#fn-61">61</a></sup></td>
                <td>39–41</td>
                <td>12</td>
                <td>1991</td>
                <td>53,884</td>
                <td>106,956</td>
                <td>26</td>
                <td>65</td>
                <td>0.79 (0.48–1.27)</td>
                <td>105</td>
                <td>251</td>
                <td>0.83 (0.66–1.04)</td>
            </tr>
        </tbody>
    </table>
</figure>

This results in a stacked table that looks like this for the first row:

  • Study group: HIP
  • Control group: 40–49
  • Study group: 12
  • Control group: 1963
  • RR (95% CI): 13,740
  • Study group: 13,740
  • Control group: 19
  • RR (95% CI)
    Breast cancer mortality at mid-range follow-up (6 to 8 years)
    20
  • 0.95 (0.51–1.78)
  • Breast cancer mortality at 14-year follow-up
    64
  • Breast cancer mortality at 14-year follow-up
    82
  • Breast cancer mortality at 14-year follow-up
    0.78 (0.56–1.08)

(Note that the <a>s in the <th>s were also being stripped, but I'll file a separate issue for that.)

What I would expect is something similar to this:

  • Study: HIP
  • Age at entry (years): 40–49
  • Screening interval (months): 12
  • Year study began: 1963
  • Total study sample size | Study group: 13,740
  • Total study sample size | Control group: 13,740
  • Breast cancer mortality at mid-range follow-up (6 to 8 years) | Study group: 19
  • Breast cancer mortality at mid-range follow-up (6 to 8 years) | Control group: 20
  • Breast cancer mortality at mid-range follow-up (6 to 8 years) | RR (95% CI): 0.95 (0.51–1.78)
  • Breast cancer mortality at 14-year follow-up | Study group: 64
  • Breast cancer mortality at 14-year follow-up | Control group: 82
  • Breast cancer mortality at 14-year follow-up | RR (95% CI): 0.78 (0.56–1.08)

Add SCSS for Full Tablesaw Suite

Currently, if I correctly understand the documentation and source, it seems that the simplified "stack only" version of this plugin includes an SCSS mixin while the full version requires linking to the full tablesaw.css file.

I would love it if the CSS for the full version was also available as an SCSS file, with mixins if that made sense or simply just as the raw CSS but more easily able to integrate into my project's SCSS build process.

Stack only mode hiding column heads when on small screen

Hi,

Whenever I minimise my screen / use an iOS device the demo shows that it is meant to put the column headers on the left side,

except when I get to a certain width it just completely removes the column headers.

Any ideas what this could be? Thanks

problem with small screen

pantalla pequea

Friend the function "$('#viewDatos').table().data( "table" ).refresh();" has a problem when it is reloaded onto small screen.

the big screen with no problem

Kitchen Sink Tablesaw arrow icons arren't loaded.

As I use gulp on my project and not grunt, so I generated all the code and icons following the instructions and left icons directory in the same directory as the .js/.css files. After some hacking everything works fine but the icons/buttons aren't loaded. So what I wanted to ask is where are these defined so that I can try to hack around it? Or is there something else wrong?

P.S. I get the following result:
bug

Columntoggle 'reset' and 'show all'

Hi,

I'm using the tablesaw with some tweaks as mentioned in #13 (comment) and to enable server side sorting and so far it's been great.
But it would be nice and useful to have a 'reset' and 'show all' checkboxes in the column-toggle popup.
'reset' would be checked by default and would allow users to reset the table after they had made any changes.
'show all' would allow users to show all the columns at a single click.

Stack table - Additional elements needed?

Hi,

I'm using the stack table and so far it's been great. However having sat down with designers they want me to be able to put a a different background on the label that sits on the left and also when text on the right is long enough to wrap, force it to line-up with the first line (at the moment it wraps underneath the label).

I've attached a screenshot of the text wrapping.

Would it be useful to have another element (a span?) to wrap the text on the right with so that we can have a bit more control over style and layout? If it is and you don't have time, I can look at forking and sending a pull request with the update in future?

Thanks,

Cliff

tablesaw-issue-screenshot

Swipe Table td width on navigate

In the Swipe Demo using Chrome:

  • re-size window to be narrow (around 400 px)
  • Refresh browser window
  • Use the nav buttons to go right or left
  • the data cells get progressively larger with each click
  • the th.ranked-name.tablesaw-cell-persist get over-run by the too-wide data cells

Sorry I don't have the time to fully debug it at the moment, but I thought I would report what I saw.

-Al

Swipe mode/persistent cols edge case prevents swiping

In swipe mode, if the screen is only wide enough to fit persistent columns, there is no way of navigating to the other cells.

In this circumstance, the persistent setting could be ignored to allow navigation. A priority option could be introduced to allow for multiple persistent columns; the highest priority would be hidden last.

Reduced test case: http://jsbin.com/buwoc/1/edit?html,output
Narrow the output window until only the address can be seen, you will not be able to navigate to the other property details.

Sorting numbers

Thank you for creating this - for the most part, it seems to be working well.

I'm testing the sorting feature with various numbers (sorry, I don't have anything online to link to).

I'm finding it doesn't handle decimals - 1.7, 1.3 etc.

or Numbers with commas - 3,567,000, 93,200,231, sometimes with dollar signs

Is there any way to have it recognize different number types? Thanks again.

Stack view affecting rows in table footer

I just added this to an existing site as an easy way to convert long table rows to be easier to read on mobile devices, but the plugin is also applying it's logic to the row(s) in the <tfoot> element, which I think ought to be excluded from it's effects.

Similarly, when I have a table that has no data, but instead has a single TR with a TD spanning all columns simply stating "No results found", it still gets converted to the stack view and placed next to the label for the first column of the table. I understand there's not much tablesaw can do about this, but similar to the above issue, maybe there's a way to mark certain rows that should be omitted from the stacked view layout alterations?

Table cells have different behavior from table titles

I created a full tablesaw table and generate the cells with jQuery to a JSON call but noticed that the cells don't have the same behavior as the table titles/headers when reducing screen-size.

What may cause this?

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.