On this page

To compare alternating table row colors, first identify both background colors and check them against each other in a contrast checker. Then run separate checks for the text on each background. The first comparison helps you judge the visibility of the stripe pattern; the text checks help you assess readability.
A single result cannot answer both questions. A table may have noticeable stripes while some text is difficult to read, or its text may be clear while the stripes are subtle. The method below gives you a way to record the combinations, interpret the results, and decide what to revisit after a change.
Gather the colors used in the table
Start by finding the two backgrounds used for the alternating rows. Call them background A and background B in your notes so you can keep the checks organized. Record their color values in a format your contrast checker accepts. If you already have reliable values, use those; otherwise, use a color picker to sample the table.
When sampling a background, choose an area inside the row that appears solid and is away from letters, borders, or other marks. Sample both backgrounds separately, even if they look similar. If a row contains a highlighted cell or another background color behind text, record that background too: the relevant comparison is with the color immediately behind the text.
Next, list every text color that appears in the table. Ordinary text is a starting point, but look for links, highlighted text, and any other text that uses a different color. Note which backgrounds each color appears on. A link color used on both A and B needs two text checks; a color used only on A needs a check against A. If the same color also appears over a highlighted cell, include that background as another pairing.
When using a picker on text, aim for a solid part of a letter rather than a lighter, smoothed edge. If the letters are too small to sample confidently, look for an existing color value or use a clearer view if one is available. Check that the value you record corresponds to the text itself, not the surrounding background.
A simple record can be a short list: background A, background B, ordinary text, link text, and any highlighted text or cell backgrounds. Beside each text color, write where it appears. This preparation makes it easier to spot a missing combination before you start interpreting results.
Compare the two row backgrounds
Enter background A and background B as the two colors in the contrast checker and note the result. A contrast ratio runs from 1:1, meaning no contrast, to 21:1, the maximum. For this comparison, the result describes the difference between the two backgrounds; it does not tell you whether the text on either one is readable.
Use the comparison alongside a view of the table. Can you follow an individual row across the columns? Can you distinguish the alternating pattern without having to study it? A subtle difference may be enough for a table where the stripes are simply a visual aid. If the pattern is important to following the information, consider whether a stronger difference or another way to follow rows would help.
Do not treat a particular row-to-row ratio as a universal requirement. Instead, use the result as a reference when trying alternatives. For example, if you change background B, compare it with A again and see whether the resulting pattern is easier to distinguish. Keep track of which version you are evaluating so you do not confuse its result with an earlier one.
Ask what the color difference is doing
Alternating backgrounds can help organize the table visually, but check whether understanding depends on the difference. If a row color also signals a status or another meaning, make that meaning available in words or with another clear cue. For example, a status written in a cell can communicate the distinction alongside the color.
Keep this background comparison separate from the next step. Even if you are satisfied with the stripes, each text color still needs to be checked against the background on which it appears.
Test text against each background
Now compare each text color with its actual background. Enter the text color as one color in the checker and the background immediately behind it as the other. Record the ratio and compare the result with the text contrast guidance applicable to the text size you are evaluating. Consult current guidance if you are unsure which target applies; do not assume that a result for one size settles the question for every piece of text in the table.
Work through the list you made earlier. The following example shows how to organize the checks when ordinary text and links appear on both alternating backgrounds and highlighted text appears only on A:
| Text | Background | Check |
|---|---|---|
| Ordinary text | A | Record result and compare with applicable guidance |
| Ordinary text | B | Record result and compare with applicable guidance |
| Link text | A | Record result and compare with applicable guidance |
| Link text | B | Record result and compare with applicable guidance |
| Highlighted text | A | Record result and compare with applicable guidance |
This is a checklist, not a fixed set of table colors. Add a row for each additional combination that actually appears, including text on a differently colored cell. Leave out combinations that are not used. If text in the same color appears at different sizes, consider the applicable guidance for each size when interpreting the result.
Read the results in context
A result for ordinary text on A says nothing by itself about link text on A, because the text color differs. Likewise, a result for a link on A does not establish how that link reads on B. Keep the color values beside your results so you can tell exactly which pair each result describes.
If your checker provides a pass or fail indication, confirm which guidance and text size it applies to before using it to make a decision. A ratio alone is useful as a measurement, but you still need the relevant target to interpret it. You can consult the official Section508.gov color guidance or the Illinois color contrast guide when checking the applicable guidance.
Mark any pairing that needs attention, and keep the successful pairings in your notes. This gives you a practical starting point for an adjustment without losing track of checks you may need to repeat.
Adjust and check the table again
When a pairing does not meet the applicable text target or is difficult to read, adjust one of its colors and check the new pair. Decide which color to change by looking at where each is used. Changing a text color may affect several backgrounds; changing a row background may affect every text color placed on that row.
If your contrast analyser has an HSL lightness control, you can adjust the shade while looking for a result that reaches the relevant text target. Record the final value you choose. If that control is not available, try another color value and repeat the check. In either case, review the table itself as well as the numerical result so you can see how the revised colors work together.
Repeat the affected checks
Use your checklist to decide what to retest. If you change background B, compare A with the new B again, then check every text color used on B against the new background. If you change a link color used on both backgrounds, test that link color against both A and B. If you change a highlighted cell background, recheck the text displayed on it.
Review the applicable text sizes again when a changed color is used at more than one size. Update your notes with the new values and results, replacing or clearly marking the old ones. This prevents an earlier result from being mistaken for the outcome of the revised table.
Finally, look for meaning carried by color. If a particular background indicates a status, add a written label or another clear cue that communicates the same information. Check that the cue is present wherever the status appears, including on alternating rows. Then review the table as a whole: the row pattern should serve its intended purpose, the text pairings should meet their applicable targets, and any status should be understandable from its accompanying cue.