Linux 软件免费装
Banner图

GT Table Block

开发者 bph
更新时间 2026年5月20日 01:57
PHP版本: 7.4 及以上
WordPress版本: 6.9
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

block gutenberg table block-editor block-variation

下载

0.1.1 0.2.0

详情介绍:

GT Table Block extends the built-in core/table block with optional features that compose cleanly — each feature is an independent toggle, not a block style, so any combination can be active on the same table. Available in this release: Planned for future releases: Why a variation, not a replacement block? The plugin deliberately extends core/table rather than forking it, so existing tables stay compatible with core as it evolves. Independent boolean attributes also let any combination of features be active at once — which block styles (a mutually exclusive radio group) cannot offer.

安装:

  1. Upload the plugin folder to /wp-content/plugins/ or install via the Plugins screen.
  2. Activate through the Plugins menu.
  3. Insert the Enhanced Table variation from the block inserter, or convert an existing Table block via the Block Settings panel.

常见问题:

Does it replace the core Table block?

No. It registers a variation. Existing core Table blocks are unaffected until you enable a feature toggle on them.

Does it need frontend JavaScript?

No. Sticky header, header column styling, and sticky first column are pure CSS. Only the editor ships JS.

Does it work with block themes?

Yes. It targets core/table and uses the wp-block-table class chain for specificity without !important.

How do I change the sticky header background color?

The sticky header is painted with an opaque background so body rows don't show through it. It resolves in this order:

  1. --gt-sticky-header-bg — a per-block or local override (wins over everything).
  2. --wp--custom--gt-sticky-header-bg — a theme.json settings.custom value.
  3. Canvas — the CSS system color (browser document background, adapts to light/dark mode).
Theme-wide via theme.json (literal color): { "settings": { "custom": { "gtStickyHeaderBg": "#f5f5f5" } } } Theme-wide via theme.json (reference a theme preset): { "settings": { "custom": { "gtStickyHeaderBg": "var(--wp--preset--color--base)" } } } The value is emitted into the CSS variable as-is, so any WP-generated preset works — --wp--preset--color--accent, --wp--preset--color--contrast-2, or any palette slug your theme registers. In both cases WordPress serializes settings.custom.gtStickyHeaderBg as the CSS variable --wp--custom--gt-sticky-header-bg, which the plugin reads as a fallback. Theme-wide via raw CSS in theme.json: { "styles": { "css": ".wp-block-table.has-sticky-header { --gt-sticky-header-bg: var(--wp--preset--color--base); } " } } Per-block override: add an inline style or Additional CSS class that sets --gt-sticky-header-bg on the <figure>.

更新日志:

0.2.0 0.1.1 0.1.0