/my-app
├── index.html (Giao diện chính)
├── style.css (Chỉnh màu Mắt Bão)
├── script.js (Xử lý logic & đọc Excel)
├── data.xlsx (File bảng giá của bạn)
└── /js
└── xlsx.full.min.js (Thư viện SheetJS - tải tại SheetJS GitHub)
Đại lý Mắt Bão
// Đọc file Excel
fetch('data.xlsx')
.then(res => res.arrayBuffer())
.then(data => {
const wb = XLSX.read(data, {type: 'array'});
const sheet = wb.Sheets[wb.SheetNames[0]];
const jsonData = XLSX.utils.sheet_to_json(sheet);
renderTable(jsonData);
});
function renderTable(data) {
const table = document.getElementById('productTable');
// Code duyệt mảng jsonData và tạo các dòng | ...
console.log(data); // Kiểm tra dữ liệu trong console F12
} |