🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/06 06:21:30
🔄 下次更新时间:2026/01/06 07:21:30
手动刷新缓存

Exportar Tablas HTML a Excel (con ExcelJS + Observer)

Agrega un botón a cada tabla HTML para exportarla a Excel usando ExcelJS

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Autor
Jairo Abraham Bernal Villanueva
Installationen heute
0
Installationen gesamt
2
Bewertungen
0 0 0
Version
1.2
Erstellt am
09.05.2025
Letzte Aktualisierung
09.05.2025
Größe
4,63 KB
Lizenz
MIT
Wird angewandt auf
Alle Seiten

Exportar Tablas HTML a Excel (Greasemonkey/Tampermonkey Script)

Este script de usuario detecta automáticamente todas las tablas HTML visibles en cualquier página web y agrega un botón flotante a cada una para exportarla como archivo .xlsx, utilizando ExcelJS.

✨ Características

  • Botón de exportación individual para cada tabla
  • Soporte completo para celdas fusionadas (rowspan, colspan)
  • Exportación directa como archivo .xlsx
  • No requiere configuración ni interacción con el código del sitio
  • Compatible con sitios que renderizan contenido dinámicamente (React, Angular, etc.)
  • Registro limpio en consola para depuración (console.clear() y console.log())

🧠 Cómo funciona

  • Usa MutationObserver para detectar tablas aunque se agreguen dinámicamente al DOM
  • Añade un botón discreto en la esquina superior derecha de cada tabla visible
  • Genera un archivo .xlsx usando la biblioteca ExcelJS

📦 Tecnologías

📥 Instalación

  1. Instala Tampermonkey en tu navegador.
  2. Haz clic en este enlace para instalar el script:
    👉 Exportar Tablas HTML a Excel
  3. Navega cualquier sitio con tablas. Verás un botón 📥 sobre cada tabla.

🛡 Seguridad

Este script:

  • No recopila ni transmite datos
  • No accede a servidores externos (salvo para cargar ExcelJS desde CDN)
  • No modifica el contenido original de la página, solo lo lee y complementa

🧪 Ejemplos de uso

  • Paneles de control empresariales
  • Sistemas ERP o CRM sin función de exportación
  • Portales académicos, gubernamentales o internos