|
| 1 | +<!doctype html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <title>Tabulator Test</title> |
| 6 | + <link rel="stylesheet" href="../../dist/css/tabulator.min.css" /> |
| 7 | + <script src="../../dist/js/tabulator.js"></script> |
| 8 | + <style> |
| 9 | + body { |
| 10 | + padding: 20px; |
| 11 | + font-family: Arial, sans-serif; |
| 12 | + } |
| 13 | + #test-table { |
| 14 | + width: 100%; |
| 15 | + height: 400px; |
| 16 | + margin-bottom: 20px; |
| 17 | + } |
| 18 | + </style> |
| 19 | + </head> |
| 20 | + <body> |
| 21 | + <h1>Tabulator Test</h1> |
| 22 | + <div id="test-table"></div> |
| 23 | + |
| 24 | + <script> |
| 25 | + // Initialize table with test data |
| 26 | + const testData = [ |
| 27 | + { id: 1, name: "Alice", age: 25, gender: "Female" }, |
| 28 | + { id: 2, name: "Bob", age: 32, gender: "Male" }, |
| 29 | + { id: 3, name: "Charlie", age: 45, gender: "Male" }, |
| 30 | + { id: 4, name: "Diana", age: 27, gender: "Female" }, |
| 31 | + { id: 5, name: "Ethan", age: 35, gender: "Male" }, |
| 32 | + ]; |
| 33 | + |
| 34 | + const columns = [ |
| 35 | + { title: "ID", field: "id", editor: "input" }, |
| 36 | + { title: "Name", field: "name", editor: "input" }, |
| 37 | + { title: "Age", field: "age", editor: "input" }, |
| 38 | + { title: "Gender", field: "gender", editor: "input" }, |
| 39 | + ]; |
| 40 | + |
| 41 | + // Create global reference for tests to access |
| 42 | + window.testTable = new Tabulator("#test-table", { |
| 43 | + data: testData, |
| 44 | + columns: columns, |
| 45 | + layout: "fitColumns", |
| 46 | + selectableRange: true, |
| 47 | + }); |
| 48 | + </script> |
| 49 | + </body> |
| 50 | +</html> |
0 commit comments