Back to column formats
Column formattingSharePoint 2019SharePoint Online

Centered Content

Demonstrates making your content be both vertically and horizontally centered (in the middle) within the cell.

Centered Content formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

Column formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "display": "table",
    "width": "100%"
  },
  "children": [
    {
      "elmType": "div",
      "txtContent": "@currentField",
      "style": {
        "display": "table-cell",
        "text-align": "center",
        "vertical-align": "middle"
      }
    }
  ]
}

From the contributor

How to use this sample

Summary

This is a basic sample that demonstrates making your content be both vertically and horizontally centered (in the middle) within the cell.

screenshot of the sample

View requirements

  • This format can be applied to any column type

Sample

Solution Author(s)
generic-centered-content.json Chris Kent

Version history

Version Date Comments
1.0 August 24, 2018 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Additional notes

None