File size: 2,029 Bytes
6c82394
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SpreadSheet Wizard</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css">
</head>
<body class="bg-gray-100 min-h-screen">
    <custom-navbar></custom-navbar>

    <main class="container mx-auto px-4 py-8">
        <div class="max-w-6xl mx-auto bg-white rounded-xl shadow-md overflow-hidden p-6">
            <div class="text-center mb-4">
                <h1 class="text-3xl font-bold text-gray-800">SpreadSheet Wizard 🧙‍♂️</h1>
                <p class="text-gray-600">Excel-like spreadsheet with formula support</p>
            </div>

            <div id="spreadsheet" class="w-full"></div>

            <div class="mt-4 text-sm text-gray-500">
                <p>Supported formulas: SUM, AVERAGE, MAX, MIN, COUNT (e.g., =SUM(A1:B2))</p>
            </div>
        </div>
    </main>

    <script>
        document.addEventListener('DOMContentLoaded', () => {
            const container = document.getElementById('spreadsheet');
            const hot = new Handsontable(container, {
                data: [
                    ['Item', 'Price', 'Quantity', 'Total'],
                    ['Product A', 100, 2, '=B2*C2'],
                    ['Product B', 150, 3, '=B3*C3'],
                    ['Product C', 200, 1, '=B4*C4'],
                    ['', '', 'SUM:', '=SUM(D2:D4)']
                ],
                colHeaders: true,
                rowHeaders: true,
                formulas: true,
                licenseKey: 'non-commercial-and-evaluation'
            });
        });
    </script>
    <script src="components/navbar.js"></script>
    <script src="script.js"></script>
</body>
</html>