=== LAFU Tables ===
Contributors: elsama101
Tags: table, data table, responsive table, pricing table, comparison table
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fast, good-looking tables for any site. Rows are in the page itself, so tables show at once, can be found in search and work without JavaScript.

== Description ==

Tables your visitors can actually use: a price list they can search, a product list they can sort and filter, a pricing table that looks right on a phone. LAFU Tables puts them on any WordPress site, made in an editor that works like a spreadsheet.

Every row of the current page is written into the page itself. The table shows the moment the page opens, search engines can read it, and searching, sorting, filters and paging keep working even when JavaScript is off. With JavaScript on, the same controls update the table in place without reloading the page.

**Completely free.** No account, no fee, no upsell screens.

= Why sites choose LAFU Tables =

* **Light pages.** Pages without a table load nothing from LAFU Tables. A page with a table adds one small script and one stylesheet, no jQuery.
* **Big tables stay quick.** Sorting and filters use their own database index, so a table with 100,000 rows still answers in a blink.
* **Edit like a spreadsheet.** Type in place, move with Tab and the arrow keys, paste straight from Excel, drag rows and columns, undo, and every change saves by itself.
* **Looks like your site.** Tables take your theme's fonts and colours, in light and dark, and you pick the look with one click.
* **Clear on every screen.** On a phone, rows turn into cards, or columns fold away behind a button, or the table scrolls sideways. You choose, per table.

= Tables =

* Unlimited tables, rows and columns.
* Column types: text, long text, number, date, HTML, link or button, image and choice.
* Search, column sorting, column filters, paging and rows per page.
* Forgiving search: accents do not matter, and a search with no results offers a close match for a typo.
* Footer totals, row groups, rows that open a page, captions and descriptions.
* Images open large in a lightbox, and a Print button prints this page or every row, without the rest of the page. Each loads only on a table that uses it.
* 22 ready templates: price lists, opening hours, schedules, team directory, product lists, pricing and comparison tables.
* A short welcome on first use: pick a template, paste from a spreadsheet or import a file, pick a look, and get the shortcode.
* Folders to keep many tables in order, and a choice of which user roles may manage tables.

= Pricing and comparison tables =

* A drag and drop builder for layout tables: merge and split cells, cell colours, a highlighted column.
* Elements in cells: text, button, icon, star rating, list, HTML and shortcode.
* Plan cards stack neatly on phones; comparison tables keep their row labels in view.

= Styles =

* Five looks: Clean, Minimal, Grid, Bold header and Soft cards.
* Your accent colour, stripes, hover, lines between rows or around every cell, compact rows, sticky header and a fixed first column.
* Colour scheme from your theme, from the visitor's device, or always light or dark.
* Hide columns per screen size, with six sizes from phone to wide screen.

= Everywhere you build =

* A block with a live preview.
* The [lafu_tables] shortcode (the older [lafu_rivi] name still works), with options to show part of a table on any page.
* An Elementor widget, loaded only when Elementor is active.
* Polylang and WPML: table texts are translated, or each language shows its own table. Loaded only when one of them is active.

= Import and export =

* CSV, JSON and Excel (.xlsx) files in and out.
* Import from TablePress, Ninja Tables and wpDataTables.

= Built right =

* Measured with our own benchmark (part of our test suite, not shipped) on a 4-core test server in October 2026: with 100,000 rows, new rows showed 97 ms after a sort click and 86 ms after a filter pick in a real browser, and the server answered a search in under 50 ms at 100,000 and at 1,000,000 rows.
* A page with a table makes the same five database queries at 1,000 rows and at 1,000,000 rows.
* The script on a table page is under 4 KB and the stylesheet about 7 KB, both gzip.
* Our test suite checks the table with JavaScript off, runs axe accessibility checks in a real browser on tables in light and dark and on every admin screen (no violations), measures layout shift (under 0.05) at phone and desktop width while searching, sorting and paging, and checks permissions on every REST route.
* Private and draft tables are never shown to visitors, and only columns you mark as public are ever sent.
* Translated into 20 languages, including Arabic and Persian, written right to left.
* Privacy tools: WordPress's personal data export and erase cover LAFU Tables, and it suggests text for your privacy policy.

= For developers =

* Shortcode: `[lafu_tables id="12"]` (or `[lafu_rivi id="12"]`). Options: `per_page`, `limit`, `skip`, `columns="name,price"`, `sort="price"`, `sort="-price"` or `sort="brand,-price"`, `sorting="0"`, `search="no"` or a starting search, `filter` (all words must match; `OR`, `-word` and "quoted phrases" work), `filter_column` with `{gt}10`, `{lt}10`, `~10:20` and dates such as `~{date-7}:{date}`, `get_filter="brand"` (takes the filter from `?brand=` in the address), `filter_selects="Brand=Kivi"`, `hide_default_filter`, `style`, `hide_header`, `logged_in_only`, `info="Page {CP} of {TP}"`.
* `[lafu_tables_info id="12" field="total_rows"]` and `[lafu_tables_cell id="12" row_id="5" column="price"]` show table details and single values anywhere. The older `lafu_rivi_*` names still work.
* Hooks: lafu_rivi_sources, lafu_rivi_column_types, lafu_rivi_importers, lafu_rivi_modules, lafu_rivi_query_args, lafu_rivi_query_result, lafu_rivi_cell_html, lafu_rivi_row_attrs, lafu_rivi_toolbar, lafu_rivi_after_table, lafu_rivi_table_settings_schema, lafu_rivi_allowed_html, lafu_rivi_admin_tabs, lafu_rivi_new_table_choices, lafu_rivi_view, lafu_rivi_display_table, lafu_rivi_translate_text, lafu_rivi_translatable_texts, and the actions lafu_rivi_table_created, lafu_rivi_table_updated, lafu_rivi_table_deleted and lafu_rivi_table_changed.
* WP-CLI: `wp lafu-rivi tables` (or `wp lafu-rivi`). Subcommands: `tables`, `modules list|on|off`, `doctor --repair`, `reindex <id>`.
* REST API under `lafu-tables/v1` (the previous `lafu-rivi/v1` namespace still works).
* Source code: the admin screens are written in readable JSX in `admin/src` and bundled, not minified, into `admin/build/rivi-admin.js` with esbuild. To rebuild, run this in the `admin` folder: `npx esbuild@0.24.0 src/index.jsx --bundle --format=iife --target=es2019 --jsx-factory=wp.element.createElement --jsx-fragment=wp.element.Fragment --legal-comments=inline --charset=utf8 --banner:js="/*! LAFU Tables admin. Source in admin/src. GPL-2.0-or-later. */" --outfile=build/rivi-admin.js`. The block (`blocks/table/index.js`) and the visitor script (`assets/front/view.js`) are plain JavaScript with no build step.

= LAFU Tables Pro =

Everything above is free and stays free. For sites that want more, the separate LAFU Tables Pro add-on adds:

* **WooCommerce product tables** with quantities, variations and add to cart
* **Live sources**: posts and custom post types, Google Sheets, CSV and JSON links, with scheduled sync
* **16 ready designs** for tables, such as a menu, a price list, a report or dark neon, plus your own saved designs
* **Conditional formatting** and **formula columns**
* **Filter builder**: dropdowns, checkboxes and ranges, in the toolbar or a panel
* **Editing on the site** for the roles you choose
* **Charts** from a table
* **Download buttons** for visitors: CSV, JSON and Excel
* **More layout elements**: image, ribbon, progress bar and more

== Installation ==

1. Install and activate LAFU Tables.
2. Open Tables in the admin menu and click New table: start blank, from a template, or from a file.
3. Type or paste your rows, then pick a look on the Style tab.
4. Add the Tables block to a page, or paste the shortcode from the Embed tab.

== Frequently Asked Questions ==

= Does logged_in_only or a shortcode filter keep rows secret? =

No. Those options only change one embed. To keep a table's rows from visitors, set the table to Private, or switch a column's Public setting off.

= Does LAFU Tables slow down my site? =

No. Pages without a table load nothing from LAFU Tables. A page with a table gets one small stylesheet and one small script with no dependencies.

= Does the table work without JavaScript? =

Yes. Search, sorting, filters and paging are normal links and a normal form, so they work with JavaScript off.

= Can search engines read my tables? =

Yes. The rows of the current page are part of the page itself, not loaded afterwards.

= How big can a table be? =

There is no limit in the plugin. Tables with hundreds of thousands of rows work, because sorting, filters and search use their own index and only one page of rows is sent at a time.

= Can I paste data from Excel or Google Sheets? =

Yes. Copy the cells, click a cell in the editor and paste. You can also import an Excel (.xlsx), CSV or JSON file.

= Can I show only part of a table on a page? =

Yes. The shortcode and the block can show chosen columns, skip rows, start with a filter or a search, and limit the number of rows. One big table can serve many pages this way.

= Does it work with my theme? =

Tables take your theme's fonts and colours. Your theme's button and heading styles stay out of the table, so it looks tidy in any theme.

= Do tables work in dark mode? =

Yes. A table can follow your theme, follow the visitor's device setting, or always be light or dark.

= What happens to my tables if I delete the plugin? =

Deleting the plugin removes its tables and settings. Turn on Keep data on uninstall in Settings to keep them.

= Does it work on multisite? =

Yes. Each site has its own tables, set up the first time LAFU Tables runs there.

== Screenshots ==

1. The table editor: type in place, paste from Excel, drag rows and columns. Every change saves by itself.
2. 22 ready templates for pricing, comparisons, price lists, schedules and more.
3. A pricing table made in the layout builder, with a highlighted plan.
4. A product list with search, column filters, sorting and paging.
5. The same table in dark mode, following the visitor's device.
6. On a phone: rows turn into cards and pricing plans stack.
7. The layout builder: merge cells, set colours and add buttons, icons, ratings and lists.
8. The Style tab: pick a look and colours, with a live preview.

== Credits ==

The icons in the admin screens and in layout tables are from Lucide (ISC licence, https://lucide.dev), drawn into the plugin as inline SVG. No fonts are bundled: tables use your theme's fonts, and nothing is loaded from other servers.

== Changelog ==

= 1.3.0 =
* Renamed to LAFU Tables. Old shortcodes, the previous REST namespace and the previous block name still work.
* Print and public table REST routes now use named permission callbacks.

= 1.2.0 =
* Image lightbox: click a picture in a table to see it large. Now in the free plugin.
* Print button: print this page or all rows of a table. Now in the free plugin.
* Fixed: loading a module twice could stop a site when a one-site helper had the same class.
* The visitor limit counts every request, also ones that arrive at the same moment.

= 1.1.0 =
* The admin is split into short sections with a live preview that shows the real layout of each screen size.
* Tables list: status, type and folder filters, sorting, paging and bulk actions.
* A short setup when you start, so your first table is on a page in a couple of minutes.
* Search ignores accents and offers a close match when nothing is found.
* Choose which roles can manage tables. Privacy export and erase. Works with Polylang and WPML.
* Very big tables: downloads use the same small amount of memory at any size, and rebuilding, duplicating, deleting and adding rows in the middle are much quicker.
* Excel import and export now work from the screen. Sizes no longer follow a theme's root font size.
* Fixes for replace imports, importing a table again, links on sites in a subfolder and very long cells.
* 20 languages.

= 1.0.0 =
* First release.
* Data tables with search, sorting, column filters, paging, footer totals and row groups. Every row of the current page is in the page itself.
* A spreadsheet-style editor with paste from Excel, drag and drop, undo and saving as you go.
* Layout tables for pricing and comparisons, with a drag and drop builder.
* 22 templates, five looks, light and dark, and phone layouts.
* A block, a shortcode and an Elementor widget.
* CSV, JSON and Excel files in and out, and import from other table plugins.
* English, Finnish and Swedish.
