By default, tables on the Knowledge Base site are left-aligned within the content area. If you want a table to appear centered on the page instead of sitting against the left edge, you can override this using Custom CSS. The change applies globally to all tables on the site.
When to use table centering
- Narrower tables: when a table only spans part of the page width, a left-aligned table can look unbalanced. Centering gives it a more polished, intentional appearance.
- Visual consistency: if other elements on the page (such as centered headings or images) are already centered, a centered table keeps the overall layout visually consistent.
- Reader focus: centering draws the reader's eye to the table by placing it in the visual middle of the page rather than off to one side.
This CSS change applies to all tables across your Knowledge base site. It is not possible to target individual tables using this method.
New tables have Fit table to page width turned on by default. On larger screens, these tables continue to span the full page width, so this snippet centers only tables with that option turned off. On smaller screens, such as mobile devices, the snippet also applies to tables with Fit table to page width turned on, so they are sized to their content and centered. To learn more, see Tables.
Quick reference
table {
width: auto !important;
margin-left: auto !important;
margin-right: auto !important;
}
How to center align a table
- In the Knowledge Base portal, go to Settings > Knowledge base site > Site customization > Custom CSS & JavaScript.

- Select the CSS tab and paste the following snippet:
table {
width: auto !important;
margin-left: auto !important;
margin-right: auto !important;
}
- Click Save.
Outcome
Before
Tables render flush against the left edge of the content area.

After
Tables render centered within the content area, with equal space on either side.

Best practices
- Remove conflicting width or margin rules first. If you already have other custom CSS targeting table (for example, a fixed width or different margin values), the centering snippet may not take effect, or may behave unpredictably, until the older rule is removed or the new one is placed after it in the CSS editor.
- Combine with cell alignment if needed. This snippet only centers the table block. If you also want the text inside cells centered, add table td, table th { text-align: center; } alongside it.
- Test with both narrow and wide tables. Centering is most noticeable on tables narrower than the page width. A table that already spans the full width looks the same either way.
- Check how tables look on mobile. Tables with Fit table to page width turned on are not affected by this snippet on larger screens, but on smaller screens they are sized to their content and centered.