CSS Classes Reference

A complete catalog of the tc- prefixed CSS classes that the TableCrafter renderer emits for tables, responsive cards, filter/pagination/export controls, inline editing, and accessibility states, so you can target them from your theme stylesheet without touching plugin code.

Styling Theming Selectors Responsive Accessibility

How TableCrafter emits markup

TableCrafter renders in two layers. The server-side shortcode handler in tablecrafter.php prints an outer container plus a JSON config blob; the browser bundle assets/js/tablecrafter.js then mounts inside that container and builds the table, cards, and all interactive controls dynamically. Every visible element gets a stable tc- class, so the safest place to add custom CSS is your theme rather than overriding the plugin's assets/css/tablecrafter.css.

A minimal shortcode produces the outer container:

// Placed by the [tablecrafter] shortcode in tablecrafter.php
<div id="my-table" class="tablecrafter-container">
  <script type="application/json" class="tc-initial-data">...</script>
</div>

After hydration, the JavaScript renderer injects a .tc-wrapper inside that container and fills it with either a table or a card grid.

i

The server container is .tablecrafter-container (with your shortcode id as the element id). The JS-rendered root inside it is .tc-wrapper. Scope custom rules to .tablecrafter-container .tc-wrapper when you want to avoid clashing with other tables on the page.

Top-level structure classes

These classes form the skeleton the renderer always produces. On desktop it builds a table; in responsive mobile mode it builds cards instead, swapping the inner block while keeping the same .tc-wrapper parent.

ClassElementPurpose
tablecrafter-containerOuter div (server)Shortcode wrapper printed by PHP; carries your id attribute.
tc-initial-datascript type="application/json"Holds the table config and seed data the JS reads on mount.
tc-wrapperdivJS-rendered root. Also where tc-high-contrast / tc-reduced-motion modifiers are added.
tc-table-containerdivScroll/overflow box around the table (horizontal scroll, border, radius).
tc-tabletableThe data table itself.
tc-cards-containerdivGrid wrapper that replaces the table in responsive mobile mode.
tc-loadingdivApplied while data loads; pairs with skeleton rows.
tc-no-resultstd / divEmpty-state message when filters return nothing.

Table and header classes

Within .tc-table, sortable column headers receive tc-sortable. The current sort direction is expressed through the standard aria-sort attribute, not a separate class, and the stylesheet draws the arrow indicator from that attribute.

Class / attributeElementPurpose
tc-sortablethMarks a clickable, sortable header. Shows a neutral ⇅ glyph by default.
aria-sort="ascending"thActive ascending sort. Styled with .tc-sortable[aria-sort="ascending"]::after to show ↑.
aria-sort="descending"thActive descending sort, rendered as ↓.
tc-editabletd / .tc-card-valueCell that supports inline editing; gets hover affordances.
tc-skeleton-rowtrPlaceholder row shown during loading.
tc-skeleton-cell / tc-skeletontd / spanShimmer cells inside skeleton rows.
💡

To restyle sort arrows, target the attribute selectors rather than adding a class. For example: .tc-table th.tc-sortable[aria-sort="ascending"]::after. The renderer keeps aria-sort in sync with the active column automatically.

Cell value helper classes

When a column has a recognized value type, the renderer wraps the value in a typed element so you can style booleans, links, images, and tags consistently. These are emitted by the cell formatter in tablecrafter.js.

ClassElementUsed for
tc-badgespanBase badge for boolean / status values.
tc-badge-successspanTruthy / "Yes" badge variant.
tc-badge-errorspanFalsy / "No" badge variant.
tc-linkaEmail (mailto:) and URL cell values.
tc-cell-imageimgImage-URL cells (lazy-loaded thumbnail).
tc-tag-listdivContainer for multi-value tag cells.
tc-tagspanA single tag chip.
tc-morespanOverflow chip, e.g. "+3 more".

Card (responsive) classes

In mobile / responsive mode the renderer swaps the table for a card grid. Cards can collapse secondary fields behind an expand toggle. The classes below are produced by the card builder.

ClassElementPurpose
tc-carddivOne record rendered as a card.
tc-card-expandabledivModifier on cards that hide extra fields.
tc-card-expandeddivState class added when a card is open.
tc-card-headerdivCard title row.
tc-card-togglespanExpand/collapse chevron (rotates when expanded).
tc-card-bodydivGrid of visible fields.
tc-card-fielddivOne label/value pair.
tc-card-labeldivField name (uppercased, muted).
tc-card-valuedivField value; combines with tc-editable when editable.
tc-card-hidden-fieldsdivSecondary fields revealed on expand.
tc-card-checkbox / tc-row-checkboxinputSelection checkbox for bulk actions.
tc-card-quick-actions / tc-quick-action-btndiv / buttonPer-card action menu.

Controls: filters, search, and pagination

Above and below the data, TableCrafter renders a filter bar, optional global search, and pagination. Each filter type adds its own sub-classes, so you can style date-range and number-range filters independently from plain select/text filters.

ClassElementPurpose
tc-filtersdivFilter region wrapper.
tc-filters-rowdivRow holding individual filters.
tc-filterdivA single filter control group.
tc-filter-label / tc-filter-inputlabel / inputFilter label and its input.
tc-global-search-container / tc-global-searchdiv / inputCross-column search box.
tc-clear-filtersbuttonReset-all-filters button.
tc-multiselect-button / tc-multiselect-dropdown / tc-multiselect-optionbutton / divMulti-value dropdown filter parts.
tc-daterange-container / tc-date-from / tc-date-todiv / inputDate-range filter inputs.
tc-numberrange-container / tc-number-min / tc-number-maxdiv / inputNumber-range filter inputs.
tc-paginationdivPagination region.
tc-pagination-infodiv"Showing X of Y" text.
tc-pagination-controlsdivButton group container.
tc-first-btn / tc-prev-btn / tc-next-btn / tc-last-btnbuttonPage navigation buttons.
tc-page-jump / tc-page-input / tc-current-page / tc-total-pagesdiv / input / spanJump-to-page control.
tc-page-size-controls / tc-page-size-label / tc-page-size-selectdiv / label / selectRows-per-page selector.

Export and bulk-action controls

When export is enabled, the renderer adds an export menu; the export handler (includes/class-tc-export-handler.php) backs CSV, XLSX, and PDF output, while these classes style the front-end trigger. Bulk operations add their own toolbar.

ClassElementPurpose
tc-export-controlsdivExport region wrapper.
tc-export-main-btn / tc-export-dropdown / tc-export-optionbutton / divExport menu trigger and format options.
tc-export-csv / tc-copy-clipboardbuttonDirect CSV download and copy-to-clipboard actions.
tc-export-icon / tc-export-title / tc-export-descspan / divPer-format option layout.
tc-bulk-controls / tc-bulk-actions / tc-bulk-infodivBulk toolbar, button group, and selection count.
tc-bulk-select-allinputSelect-all checkbox.
tc-bulk-edit / tc-bulk-delete / tc-bulk-exportbuttonBulk operation buttons.

State, feedback, and editing classes

Transient UI states use dedicated classes you can hook into, for example to brand the error retry button or the toast notifications.

ClassPurpose
tc-loading-containerLoading panel wrapper.
tc-error / tc-error-container / tc-error-messageError state and its message.
tc-retry-buttonRetry button shown on fetch failure.
tc-toast / tc-toast-success / tc-toast-errorTransient notification toasts (type suffix appended).
tc-modal / tc-modal-overlay / tc-modal-header / tc-modal-title / tc-modal-form / tc-modal-actions / tc-modal-closeAdd/edit record modal parts.
tc-edit-input / tc-edit-select / tc-edit-textarea / tc-edit-checkbox / tc-edit-color / tc-edit-file / tc-edit-radio / tc-edit-rangeInline edit widgets per field type.
tc-validation-error / tc-validation-message / tc-field-error / tc-field-validInline validation feedback.
tc-refresh-toggle / tc-refresh-manual / tc-refresh-indicator / tc-refresh-status / tc-last-updatedAuto-refresh controls and status.

Theming with CSS variables and accessibility classes

TableCrafter does not expose a global palette of CSS custom properties for normal rendering; the default look is set with hard-coded values in assets/css/tablecrafter.css. The custom properties that do exist are defined inside the high-contrast accessibility mode, and the renderer toggles accessibility modifier classes on .tc-wrapper based on the user's OS preferences (prefers-contrast, prefers-reduced-motion).

Class / variableScopeEffect
tc-high-contrastModifier on .tc-wrapperActivates the high-contrast theme and defines the variables below.
--tc-border-colorWithin .tc-high-contrastTable border color (default #000000).
--tc-text-colorWithin .tc-high-contrastCell text color.
--tc-bg-colorWithin .tc-high-contrastCell background color.
--tc-focus-colorWithin .tc-high-contrastFocus outline color (default #ff0000).
tc-reduced-motionModifier on .tc-wrapperCollapses animations/transitions to near-zero duration.
tc-focusedElement stateKeyboard-focus marker used for high-contrast outlines.
tc-sr-onlyUtilityVisually hidden, screen-reader-only text.

Because the high-contrast variables are scoped to .tc-high-contrast, you can override them per table to recolor that mode:

/* Recolor TableCrafter's high-contrast mode in your theme */
.tc-wrapper.tc-high-contrast {
  --tc-border-color: #222;
  --tc-focus-color: #0a58ca;
}

/* Brand the default table header without editing the plugin */
.tablecrafter-container .tc-table th {
  background-color: #0f172a;
  color: #fff;
}
⚠

Several plugin rules use !important (notably the high-contrast and reduced-motion blocks). If an override does not take effect, raise specificity (e.g. prefix with .tablecrafter-container) or match the !important declaration. Avoid editing assets/css/tablecrafter.css directly, since plugin updates overwrite it.

Putting it together

A typical styling workflow: drop a table on a page, find its container, then scope rules to it.

[tablecrafter id="orders" source="csv" file="orders.csv" sortable="true"]

That renders #orders.tablecrafter-container.tc-wrapper.tc-table-containertable.tc-table. Add your CSS to the theme's stylesheet or Appearance → Customize → Additional CSS, scoped to #orders or .tablecrafter-container so other tables stay untouched. Enqueue order matters: your theme stylesheet should load after tablecrafter.css (the default for theme styles) so your selectors win at equal specificity.

Next, see shortcode-attributes.html for the attributes that control which of these elements render, and javascript-events.html for the client-side hooks you can listen to after the renderer mounts.