Language selection

Search


Math equation grid - documentation

Purpose

To create a way to layout simple math equations or calculations.

Usage

Use to

Do not use to

Working examples

Evaluation and report

Not yet evaluated

Accessibility guidance

Use HTML entity names or codes for math symbols in order display without CSS or additional accessibility support.

Style HTML symbols instead of using icons, unless you have a fall back in case the icon style sheet does not load. Icons also need invisible text for screen reader devices.

HTML math entities
Character Description HTML entity HTML code
+ Plus sign + or + +
Minus sign − −
× Multiplication sign × ×
÷ Division sign ÷ ÷
= Equal sign = or = =
% Percent sign % or % %

How to implement

  1. Create a parent element
    <div class="wb-math-grid">
  2. Create a row for each line item and calculation
    <div class="mg-row">
  3. Create the same number of cells needed to display each line item fully

    Using <div> on cell

    <div class="wb-math-grid">
    <div class="mg-row">
    <div class="mg-cell"></div>
    ...
    </div>
    </div>
    Use <div> elements, as inline elements may cause unexpected issues
  4. Repeat for the amount of rows needed for the equation
    Use an equal number of cells for all rows of the equation, even when there is no content. If the aligned cell does not have information, leave it blank.

Configuration options

Class options

Custom classes for math grid
Class Description How to configure
mg-spcd Adds 10px (5px top/5px bottom) of spacing to all or specific rows
  • All rows:
    <div class="wb-math-grid mg-spcd">
  • Specific rows:
    <div class="mg-row mg-spcd">
mg-brdr-otln Adds a stronger border line around the entire cell
<div class="mg-cell mg-brdr-otln">
mg-brdr-tp Adds a stronger border line along the top of a row or specific cell
  • Specific rows:
    <div class="mg-row mg-brdr-tp">
  • Specific cells:
    <div class="mg-cell mg-brdr-tp">
mg-brdr-bttm Adds a stronger border line along the bottom of a row or specific cell
  • Specific rows:
    <div class="mg-row mg-brdr-bttm">
  • Specific cells:
    <div class="mg-cell mg-brdr-bttm">
mg-brdr-lft Adds a stronger border line on the left of a specific cell
<div class="mg-cell mg-brdr-lft">
mg-brdr-rght Adds a stronger border line on the right of a specific cell
<div class="mg-cell mg-brdr-rght">
mg-scroll Adds a scroll to equations who's rows are set with no wrapping (to preserve inheritance from original design)
<div class="mg-scroll">
<div class="wb-math-grid">

You can also use many existing GCWeb styling for this component.

Attribute options

Custom options for math grid
Option Description How to configure Values
srPause Will require screen readers to navigate the equation more precisely. data-wb-math-grid='{"pause": true}'
None/false (default):
Will read equation line by line
true
Will read each "cell" separately.

Source code

Source code for the math grid plugin on GitHub

Page details

Date modified: