=== Simple Table Block Extension ===
Contributors: ayumitabuchi
Donate link: https://sora-style.org/donate/
Tags: table, block editor, gutenberg, responsive, cells
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Extends the core Table block with multi-cell selection, th/td switching, spreadsheet-style merge controls, and responsive display options.

== Description ==

Simple Table Block Extension enhances the built-in WordPress Table block (`core/table`) without replacing it.

You can select multiple cells, switch between heading (`th`) and data (`td`) cells, merge or unmerge cells from the familiar **Edit table** toolbar menu, and configure responsive table display from the block settings sidebar.

The plugin works entirely inside the block editor. Editor scripts and styles load in the block editor so the Table block can be extended as soon as it is added. On the front end, table layout styles load only when a Table block is rendered.

= Key features =

* Extends the core Table block instead of adding a separate block type.
* Multi-cell selection with Cmd/Ctrl + click and Shift + click range selection.
* Cell highlight for single and multiple selected cells in the editor.
* Convert cells to `th` or `td` from the **Edit table** menu.
* Spreadsheet-style merge controls: Merge all, Merge vertically, Merge horizontally, and Unmerge cells.
* Responsive display options per table block:
  * Enable horizontal scrolling on desktop (769 px or wider).
  * Enable horizontal scrolling on mobile (768 px or narrower).
  * Optional table width for each scroll option (px, %, em, rem, or vw).
  * Stack vertically on mobile (768 px or narrower).
* Lightweight front-end asset loading when a Table block is rendered.

== Installation ==

1. Upload the `simple-table-block-extension` folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress Plugins screen.
2. Activate the plugin through the Plugins screen in WordPress.
3. Edit a post or page in the block editor and add or select a Table block.

== Usage ==

= Selecting cells =

* Click a cell to select it.
* Use Cmd (Mac) or Ctrl (Windows) + click to add or remove cells from the selection.
* Use Shift + click to select a rectangular range within the same table section (`thead`, `tbody`, or `tfoot`).

= Editing cells from the toolbar =

1. Select one or more cells.
2. Open **Edit table** in the block toolbar.
3. Choose one of the extension menu items:
   * Convert to heading cell
   * Convert to data cell
   * Merge all
   * Merge vertically
   * Merge horizontally
   * Unmerge cells

= Responsive display settings =

1. Select a Table block.
2. Open the **Settings** panel in the block sidebar.
3. Use the extension toggles at the bottom of the panel:
   * Enable horizontal scrolling on desktop
   * Enable horizontal scrolling on mobile
   * Stack vertically on mobile

= Table width for scroll layouts =

When **Enable horizontal scrolling on desktop** or **Enable horizontal scrolling on mobile** is turned on, a **Table width** field appears below the option help text.

Use it to set how wide the table should be at that viewport range. This helps wide tables overflow their container so horizontal scrolling can appear.

1. Turn on the desktop or mobile scroll option.
2. Enter a numeric value in **Table width**.
3. Choose a unit from the selector: `px`, `%`, `em`, `rem`, or `vw`.

Notes:

* Desktop width applies when the viewport is 769 px or wider.
* Mobile width applies when the viewport is 768 px or narrower.
* If no width is set, the table keeps its default width.
* Width values are saved per Table block.

== Screenshots ==

1. Edit table menu. Extension controls appear inside the core **Edit table** dropdown alongside the standard row and column actions, including **Convert to heading cell** and **Convert to data cell**.
2. Convert cells. Select one or more cells in the editor. Selected cells are highlighted for easier editing. Then switch them between heading (`th`) and data (`td`) cells from the **Edit table** menu.
3. Merge controls. Spreadsheet-style merge options are available for rectangular selections.
4. Responsive settings. Per-block responsive display options appear in the Table block settings sidebar.

== Frequently Asked Questions ==

= Does this plugin replace the core Table block? =

No. It extends the existing core Table block.

= Can I use it with existing tables? =

Yes. Select any existing Table block in the block editor to use the extension features.

= Does it work in the Classic Editor? =

No. This plugin is for the block editor (Gutenberg) only.

= Why is Merge all disabled? =

Merge all requires a rectangular multi-cell selection. Merge vertically needs at least two rows, and merge horizontally needs at least two columns.

= Can I use both mobile scroll and stack options together? =

Both can be enabled, but stacking usually takes visual priority on narrow screens. In most cases, choose the option that best fits your layout.

= Do I need to set a table width for scrolling? =

No. Horizontal scrolling still works when the table content is naturally wider than the container. Set **Table width** when you want to force a specific width at desktop or mobile breakpoints.

= Does this plugin call external services? =

No. It does not load remote assets, tracking scripts, or third-party services.

== Privacy ==

This plugin does not collect, store, or transmit personal data.

It does not call external services or load remote assets.

== Changelog ==

= 1.0.0 =

* Initial release.
* Multi-cell selection for the core Table block.
* th/td conversion and spreadsheet-style merge controls in the Edit table menu.
* Responsive display settings for desktop and mobile viewports.
* Optional table width controls for desktop and mobile scroll layouts.

== Upgrade Notice ==

= 1.0.0 =

Initial release.
