=== Rowlane Table Extras for TablePress ===
Contributors: nihad1122
Tags: tablepress, responsive tables, table filter, table export, fixed header
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Responsive mode, column filters & search, export buttons, fixed header, frozen columns, row grouping and more for free TablePress tables.

== Description ==

**Rowlane Table Extras for TablePress** adds the interactive table features many site owners miss from the free TablePress plugin — without changing your tables or their shortcodes. Turn a feature on site-wide, per table, or per shortcode, and it applies to any table that has the built-in "Use DataTables" option enabled.

Features in this version:

* **Responsive mode** — on small screens, columns that don't fit collapse into an expandable row, so tables stay readable on phones.
* **Column filter dropdowns** — a select box per column (all columns, or the ones you pick) that filters the table to one value.
* **Column search fields** — a text input per column for live, as-you-type substring searching of that column.
* **Search panes** — filter panes above the table showing each column's values with counts; click values to filter (with cascading and totals).
* **Search builder** — build condition-based filters (column + condition + value) combined with AND/OR groups.
* **Search highlighting** — the current search term is highlighted in matching cells.
* **Column reorder** — visitors drag columns to reorder them; the order is remembered per visitor (with a reset button).
* **Export buttons** — Copy, CSV, and Print buttons above the table, in their own row so pagination and search are untouched.
* **Fixed header** — the header row stays visible while you scroll the page.
* **Frozen columns** — freeze one or more leading columns while scrolling sideways.
* **Row grouping** — group rows by the values in a column.
* **Index column** — a leading auto-numbered column that renumbers as the table is sorted, filtered, or paged.
* **Alphabet search** — A–Z buttons that filter a chosen column by first letter.
* **Auto pre-filter** — apply an initial search term when the table loads.
* **Content highlighting** — colour cells or rows based on their content (e.g. numbers over a threshold, or a matching category).
* **Fuzzy search** — a typo-tolerant global search, so "banna" still finds "Banana".
* **Inverted filter** — an "Invert" toggle that shows the rows which do NOT match the search.
* **Row filtering** — show only the rows that match a rule (e.g. one category, or a value over a threshold), rendered server-side.
* **Row reorder** — visitors drag rows to reorder them for their own view (does not change the saved table).
* **Advanced pagination** — choose the pagination style and a custom page-length menu (including "All").
* **Table layout** — reposition the length menu, search box, info text and pagination.
* **Default table style** — set site-wide colours (header, stripe, border, hover), striping, row density and border style.

This is an independent add-on. It is **not affiliated with, endorsed by, or sponsored by TablePress** or its author; the name is used only to describe compatibility. The plugin does nothing when TablePress is inactive or when a paid TablePress plan is in use.

= How to use =

1. In TablePress, make sure the table has the **"Use DataTables"** feature enabled (Edit table → Table Options).
2. Enable the features you want on the **Rowlane Table Extras** settings screen — either as site-wide defaults or per table.
3. Or set them per shortcode, e.g. `[table id=1 te_responsive="on" te_buttons="copy,csv,print" te_fixed_header="on" te_column_filters="all" te_column_search="1" te_search_panes="all" te_search_builder="on" te_search_highlight="on" te_column_reorder="on" te_fixed_columns="1" te_row_group="2" te_index_column="on" te_alphabet="2" te_auto_filter="Fruit" te_highlight="5:gt:30:green;2:eq:Bakery:blue:row" te_fuzzy="on" te_invert="on" te_row_filter="2:eq:Bakery" te_row_reorder="on" te_paging_type="full_numbers" te_length_menu="10,25,50,all" te_layout="bottom" /]`. The same keys work in the TablePress block's "Configuration parameters" field.

Content highlighting rules are `;`-separated as `column:operator:value:color[:scope]` — operator is one of eq, neq, contains, gt, lt, gte, lte; color is green, red, yellow, blue, orange, or gray; scope is cell (default) or row. Row-filtering rules use the same `;`-separated `column:operator:value` form (a row must match every rule to be shown). The default table style is a site-wide setting only, on the Table Extras settings screen.

= Privacy =

The plugin makes no external requests and stores no personal data. All scripts and styles are served from your own site.

== Frequently Asked Questions ==

= Do I need to change my tables? =

No. Enable a feature and it applies to your existing tables and shortcodes. It only enhances tables that have TablePress's "Use DataTables" option turned on.

= Does it work with the TablePress block? =

Yes. Put the same attributes (for example `te_responsive=on`) in the block's "Configuration parameters" field.

= I use TablePress Pro/Max. Will this conflict? =

No. On any paid TablePress plan the add-on automatically stands down, because those plans already provide these features.

= Which libraries are bundled? =

The DataTables JavaScript library and its Select, SearchPanes, SearchBuilder, Responsive, Buttons, FixedHeader, FixedColumns, RowGroup, ColReorder, and RowReorder extensions, plus mark.js for search highlighting (all MIT-licensed). See `assets/datatables/LICENSES.txt`.

= Where is the source for the bundled JavaScript? =

`assets/datatables/te-datatables.min.js` is a concatenation of the above libraries' official npm distributions plus this plugin's own un-minified helper sources in `assets/js/src/`. The exact versions are pinned in `package.json` and listed in `assets/datatables/LICENSES.txt`. Rebuild it from source with `npm ci && npm run build` (the build is `assets/js/build-datatables.mjs`); `npm run dist` produces the distributable package. No code is obfuscated.

== Screenshots ==

1. A table collapsing responsively on a narrow screen.
2. Column filter dropdowns above the table.
3. Copy/CSV/Print export buttons.
4. The Rowlane Table Extras settings screen with site-wide defaults and per-table overrides.

== Changelog ==

= 1.7.0 =
* New: Fuzzy search (typo-tolerant), Inverted filter (show non-matching rows), and Row filtering (server-side, show only rows matching a rule).
* New: Row reorder (visual drag, per session), Advanced pagination (pagination style + custom page-length menu), and Table layout (reposition the controls).
* New: Default table style — a site-wide customizer for header/stripe/border/hover colours, striping, row density and border style.
* Bundles DataTables RowReorder (MIT); see the source note below.

= 1.6.1 =
* Accessibility: the column filter dropdowns and search inputs now carry accessible names; the alphabet bar is labelled, exposes the active letter to screen readers, and its disabled letters are keyboard-safe.
* Hardening: cell values are now read as inert text when building column filter dropdowns and the alphabet bar, so table content can never execute markup.
* Hardening: all inline configuration is JSON-encoded with HTML-safe flags.
* Housekeeping: the bundled script URL is versioned for correct cache-busting on updates; removed a redundant textdomain load (WordPress loads translations automatically); tested up to WordPress 7.1.

= 1.6.0 =
* New: Index/counter column, Alphabet search, Auto pre-filter, and content highlighting (colour cells/rows by their content). With the index column on, all other features' column numbers still refer to your original data columns.

= 1.5.0 =
* New: Column search fields — a debounced, as-you-type text search input per column (substring). Coexists with the dropdowns in one filter row and follows column reorder.

= 1.4.0 =
* New: Column reorder — visitors drag columns to reorder; the order persists per visitor (30 days) with a reset button, and column filter dropdowns follow the new order.

= 1.3.0 =
* New: Search highlighting — the current search term is highlighted in matching cells (via mark.js).

= 1.2.0 =
* New: Search builder — condition-based filtering (column + condition + value, with AND/OR groups).

= 1.1.0 =
* New: Search panes — filter panes above the table with per-value counts, cascading, and totals.

= 1.0.0 =
* Initial release: responsive mode, column filter dropdowns, export buttons (Copy/CSV/Print), fixed header, frozen columns, and row grouping.
