Back to form formats
Form formattingSharePoint Online

Dashed Line Header

This sample displays the Title and Description values in the heading and decorates them with dashed lines. If the Description value is empty, it will be hidden.

Dashed Line Header formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

3 definitions

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.

Form header
Download JSON
{
  "elmType": "div",
  "attributes": {
    "class": "ms-bgColor-themePrimary ms-fontColor-white"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "margin": "10px",
        "width": "100%",
        "border": "2px dashed",
        "padding": "10px",
        "display": "=if([$Title] == '' , 'none' , 'flex')",
        "flex-direction": "column"
      },
      "children": [
        {
          "elmType": "div",
          "txtContent": "[$Title]",
          "style": {
            "text-align": "center"
          },
          "attributes": {
            "class": "ms-fontSize-28 ms-fontWeight-bold"
          }
        },
        {
          "elmType": "div",
          "txtContent": "[$Description]",
          "style": {
            "text-align": "center",
            "display": "=if([$Description] == '' , 'none' , '')"
          },
          "attributes": {
            "class": "ms-fontSize-16"
          }
        }
      ]
    }
  ]
}

From the contributor

How to use this sample

Summary

This sample displays the Title and Description values in the heading and decorates them with dashed lines. If the Description value is empty, it will be hidden.

screenshot of the sample

Additional alignments

dashed-line-header-align-center.json screenshot of the sample

dashed-line-header-align-right.json screenshot of the sample

Form requirements

Type Internal Name Required
Single line of text Title Yes
Multiple lines of text Description No

Sample

Solution Author(s)
dashed-line-header.json Tetsuya Kawahara
dashed-line-header-align-center.json Tetsuya Kawahara
dashed-line-header-align-right.json Tetsuya Kawahara

Version history

Version Date Comments
1.0 February 7, 2021 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.