Git Product home page Git Product logo

sheetjs's Introduction

sheetjs

Apply a simple spreadsheet UI to your table tag as a jQuery-plugin.

Just write 'sheetjs' class into your 'table' tag!

Usage

  1. Import jQuery(1.x, 2.x or 3.x) and Material Icons from CDN
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
  1. Import jquery.sheetjs.css and jquery.sheetjs.js
<link rel="stylesheet" href="jquery.sheetjs.css" />
<script src="jquery.sheetjs.js"></script>
  1. Set "sheetjs" class to your table tag
<table class="sheetjs">
  <caption>Table name(optional)</caption>
  <thead>
    <tr>
      <th>A</th>
      <th>B</th>
      <th>..</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>a</td>
      <td>b</td>
      <td>..</td>
    </tr>
    ..
  </tbody>
  <tfoot>
    (optional)
  </tfoot>
</table>

That's it!

Please see the sample.html .

Specifications

  • Prerequisites

    • Table tag is complete. Use thead, tbody, tfoot and caption properly.
    • Works on both IE7 and Chrome.
  • Functions

    • Cell selection
      • Click the cell to select it.
      • Click with Shift-key, the rectangle will be selected.
      • If another area is selected, the selection will be removed.
    • Line selection
      • Click 'th' at the beginning of a line in tbody, you can also select the line
      • Clicking on other element on th is not work
    • Column selection
      • Click on a colum 'thead th' to select all the columns with thead, tbody and tfoot.
      • 'th' only. 'td' does not react.
    • Value copy
      • Selecting cell text can be copy into your clipboard with Copy command, 'Ctrl + c' or right-click.
      • The copied value is in TSV (tab separated) text format and can be pasted into Excel as it is.
      • The text does not include INPUT or A tag link information. Extract only pure text
    • Filter
      • Select a cell and right-click to Filter to filter the entire table with the selected value
    • Line count display
      • The number of displayed tbody columns is automatically counted and displayed on the screen. If you have declared a caption tag.
    • Total value display
      • Sum the value of the selected cell and display it. If you have declared a caption tag.
      • Take out what looks like a number and add it up. For example, if you select 1,000 yen and A-100, 1000+ (-100) will be 900.
    • Header fixed
      • Follow only the header title as the window scrolls
  • Functional restrictions in IE

    • No header fixed
    • No icons in IE7

sheetjs's People

Contributors

hidehitomobile 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.