Django Template Filter - center

Definition and Usage

The center filter places the value in the center of a value of the specified length.

Syntax

{{ value|center:length }}

Template filters are defined by using a pipe | character followed by the name of the filter.

Arguments are defined by using a colon : character followed by the argument value.

Arguments

Value Description
length Required. A number specifying the length of the field where the value will be in the center.