Created
December 21, 2025 08:35
-
-
Save naosim/18f4d4f9d01b72839213884831d7d126 to your computer and use it in GitHub Desktop.
tabulator sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <!-- CSSの読み込み --> | |
| <link href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet"> | |
| <!-- JSの読み込み --> | |
| <script type="text/javascript" src="https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js"></script> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <div id="example-table"></div> | |
| <script> | |
| // 表示するデータ | |
| var tableData = [ | |
| { id: 1, name: "田中", age: 25 }, | |
| { id: 2, name: "鈴木", age: 30 }, | |
| ]; | |
| // テーブルの設定 | |
| var table = new Tabulator("#example-table", { | |
| data: tableData, // データの設定 | |
| columns: [ | |
| { title: "ID", field: "id", width: 50 }, | |
| { title: "名前", field: "name", width: 150 }, | |
| { title: "年齢", field: "age", hozAlign: "right" }, | |
| ], | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment