Skip to main content

League Table Columns

League Table Columns are the calculated columns that appear in league table standings — for example, Played, Won, Drawn, Lost, Goals For, Goals Against, Goal Difference, and Points. Each column is a WordPress post of type `sp_column`.

Updated today

League Table Columns

League Table Columns are the calculated columns that appear in league table standings — for example, Played, Won, Drawn, Lost, Goals For, Goals Against, Goal Difference, and Points. Each column is a WordPress post of type sp_column.

Every column has an equation that SportsPress evaluates against the stored event data for each team. The result is what appears in the cell for that team and column.

Navigate to SportsPress > Configure to see the full list, or use the View All link in the Table Columns section.

Fields

Each column has the following fields:

  • Label — The column header displayed in the league table (for example: P, W, Pts).

  • Key — The internal slug used to identify this column in sort priority references. Set in the Details meta box.

  • Equation — The formula used to calculate the column value for each team. Built using the drag-and-drop builder or typed as a custom expression. See the Equation Builder section below.

  • Decimal Places — The number of decimal places shown in the column. Set in the Details meta box. Defaults to 0.

  • Sort Order — The priority and direction by which this column sorts teams in the table. Set in the Details meta box using two controls:

    • Sort Order priority — A numeric priority from 1 (highest) to the total number of published columns, or Disable (0) to exclude this column from sorting.

    • Descending / Ascending — The direction of the sort. Descending places the highest value at the top; Ascending places the lowest value at the top.

  • Description — Internal notes displayed only in the admin dashboard.

The Configure screen summary table shows Label, Equation, Decimal Places, and Sort Order for each column.

The Equation Builder

The Equation meta box presents a drag-and-drop palette of tokens grouped into categories. Click a token to append it to the equation. Click the × on any token in the formula to remove it.

The equation builder for Table Columns accepts tokens from the following groups:

  • EventsPlayed ($eventsplayed) and Minutes ($eventminutes).

  • Results — Every defined Event Result, in both for and against variants (for example: Goals (for) and Goals (against)).

  • Outcomes — Every defined Event Outcome (for example: $win, $draw, $loss).

  • Subsets — Location-based filters: @Home (_home), @Away (_away), @Venue (_venue). Append a subset token after a result or outcome token to restrict that variable to home or away events only.

  • Presets — Built-in complex calculations: Games Back ($gamesback), Home Record ($homerecord), Away Record ($awayrecord), Streak ($streak), Form ($form), Last 5 ($last5), Last 10 ($last10).

  • Operators+, -, ×, ÷, (, ). When the Conditional Equations module is active, the comparison operators >, <, , , , are also available.

  • Constants — Integers 0 through 10, and 100.

You can also type a custom equation string directly into the formula area instead of using the drag-and-drop buttons. The formula is saved as a space-separated string, for example: $win * 3 + $draw.

Sort Priority

Multiple columns can each have a sort priority assigned. The league table sorts teams first by the column with priority 1, then breaks ties using priority 2, then priority 3, and so on.

To set a column as the primary sort key, assign it priority 1. To exclude a column from table sorting entirely, set its priority to Disable.

The sort direction (Descending or Ascending) applies independently to each column. Most columns sort descending (higher points at top). A column like Goals Against might be sorted ascending if you want fewer goals against to rank higher.

Adding a Table Column

  1. Go to SportsPress > Configure.

  2. In the Table Columns section, click Add New.

  3. Enter the Label (title) in the post title field.

  4. In the Details meta box (sidebar), set the Key, Decimal Places, and Sort Order.

  5. In the Equation meta box, build the formula by clicking tokens or typing a custom equation.

  6. Optionally add a description in the Excerpt field.

  7. Set the display Order in the Attributes box.

  8. Click Publish.

Did this answer your question?