Linux 软件免费装
Banner图

Table Block Sort

开发者 orcnd
更新时间 2026年12月3日 21:53
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

sortable table csv export table search table block

下载

0.1.0

详情介绍:

WordPress has a Table block, but visitors cannot sort, search or download it. The usual answer is a separate table plugin with its own editor and its own way of storing tables. Table Block Sort keeps the Table block you already use and adds switches to it. Select a table. Its toolbar gets four buttons next to "Edit table": sort (two arrows), search (magnifying glass), striped rows (three bands) and download (arrow into a tray). Each stays highlighted while it is on. A "More table tools" menu after them holds phone cards, sticky header, "Show more" and the share button. The block sidebar gets a "Visitor tools" panel with all of them. How columns are sorted Each column is checked as a whole. When more than half of its cells are dates, it sorts by date; when more than half are numbers, by number; otherwise as text. Accessible The sort buttons work with the keyboard (Tab, then Enter or Space). The sorted column is announced to screen readers with aria-sort, following the WAI-ARIA sortable table pattern. The search field and the download icon have text labels for screen readers, and the number of matching rows is announced as it changes. The arrow follows the theme's text color and stays visible in Windows high-contrast mode. What it does not do Light. One readable JavaScript file (about 38 KB, 12 KB compressed) and a 10 KB stylesheet, loaded only on pages that have a table using one of these tools. Without JavaScript the table shows as a normal table and the search field and download button stay hidden. The CSV file is made in the visitor's browser; nothing is sent to your server or anywhere else. No jQuery, no external requests, no tracking, no settings stored in the database. The setting is saved in the block itself, so deactivating the plugin leaves your tables as normal tables.

安装:

  1. Install and activate Table Block Sort from the Plugins screen.
  2. Edit a post or page with a Table block and make sure "Header section" is on in the block's Settings.
  3. Click the sort, search, stripes or download button in the table's toolbar, or use the "Visitor tools" panel in the block sidebar, and update the post.

屏幕截图:

  • In the editor: the sort, search, stripes and download buttons next to "Edit table", and the "Visitor tools" panel.
  • The "More table tools" menu: cards on phones, sticky header, "Show more" button and share button.
  • On a phone: rows become cards, and sorting moves to a menu of column names with up and down arrows.
  • A long table with a sticky header row.

常见问题:

Does it work with tables I made before installing it?

Yes. Open the post, select the table and turn on what you need in its toolbar or sidebar. Nothing changes on any table until you do.

Can the table be sorted by a column when the page loads?

Not in this version. The table shows in the order you entered it until a visitor clicks a header.

What happens when I deactivate the plugin?

The tables stay as they are and are no longer sortable or searchable. Striped rows stay, because they are a core style. Your table content is never changed.

Can someone put a formula into a cell and attack people who open the CSV?

No. Cells that a spreadsheet would run as a formula (starting with "=", "+", "@", or "-" followed by text) get an apostrophe in front, so they open as plain text. Negative numbers such as "-12" are kept as numbers.

What does the search look at?

The text of every cell in the body rows. Header and footer rows are always shown.

Which browsers show the search highlight?

Browsers with the CSS Custom Highlight API: current Chrome, Edge, Safari and Firefox. Older browsers still search; they just do not mark the matching text.

Does it work in the site editor and in templates?

Yes. It works on any core Table block that WordPress renders on the front end.

更新日志:

0.1.0