Skip to content

Add DataTables component for enhancing markdown tables #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

aerdman1
Copy link

@aerdman1 aerdman1 commented Apr 7, 2025

DataTables Component

The DataTables component adds interactive filtering, searching, and export tools to every Markdown-rendered table on the page. It enhances ReadMe’s default table output using DataTables, without requiring any special syntax or wrapping.

🧰 Features

  • Adds a toggle button to each table
  • Enables:
    • Column visibility control
    • CSV, Excel, and PDF export
    • Table search/filtering
    • Copy and print options
  • All enhancements can be toggled off to restore the original table

Usage

You do not need to wrap your tables. Instead, add the <DataTables /> component anywhere on the page—preferably at the bottom or top of your doc. Then write your tables like normal in Markdown:

### Table: API Endpoints

| Endpoint      | Method | Description           |
| ------------- | ------ | --------------------- |
| `/users`      | GET    | List users            |
| `/users/{id}` | GET    | Get a specific user   |
| `/users`      | POST   | Create a new user     |

✅ Once the page loads, each table will show a toggle button that activates DataTables functionality when clicked.

Notes

  • No props are required—this component acts globally and automatically.
  • External dependencies (jQuery, DataTables, export plugins) are loaded automatically.
  • Accessible by keyboard and screen readers with labeled buttons and inputs.
DataTables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants