handsontable 的使用方法

Handsontable是一款简洁的、类似Excel的数据网格编辑器,适用于HTML、JavaScript及jQuery。它支持自动扩展、自动完成、新增行列等功能,并提供滚动、上下文菜单等特性。所有输入的数据可以复制粘贴到Excel或其他表格软件中。

Excel-like Data Grid Editor ForjQuery - handsontable

handsontable is a aminimalistic Excel-like data grid editor for HTML,JavaScript & jQuery. It allows you to use auto-expanding and auto-completeas well as add new rows and columns. It also includes a legend, scrolling (so as your tablegrows, it won’t take up your entire page and become unwieldy), context menus,conditional formatting and other features. You can even set it to track changesmade to the table. And, all the data you enter in Handsontable can be copiedand pasted to Excel, Google Spreadsheet, or LibreOffice.

You might also like:

·        jQueryEditable Spreadsheet Plugin For Handsontable - handsontable-excel

How to use it:

1. Include jQuerylibrary and handsontable.js

1

2

<scriptsrc="../lib/jquery.min.js"></script>

<scriptsrc="dist/jquery.handsontable.full.js"></script>

2. Includehandsontable CSS to style your plugin

1

<linkrel="stylesheet"media="screen"href="dist/jquery.handsontable.full.css">

3. Markup

1

<divid="dataTable"></div>

4. Call the pluginand load some data if you wish

1

2

3

4

5

6

7

8

9

10

11

12

13

<script>

  vardata = [

    ["",  "Kia", "Nissan", "Toyota", "Honda"],

    ["2008",  10, 11, 12, 13],

    ["2009",  20, 11, 14, 13],

    ["2010",  30, 15, 12, 13]

  ];

  $("#dataTable").handsontable({

    data:  data,

    startRows:  6,

    startCols:  8

  });

</script>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值