
A live odds board comes with plenty of challenges, and the design isn’t the main one. First of all, it presents a lot of information, which should be readable and understandable by users.
On top of that, there are many processes that run in the background. The prices change, the rows move around, and suddenly you’re reading about a different horse from the one you started with.
So, the goal is to build a live odds board that updates automatically without any layout shifts that might ruin the user experience.
Start With a Price Change You Can Follow
Horse racing live odds boards have a lot of data, especially for popular events. When building around the 2027 Kentucky Derby contenders, each horse needs an identity that survives a price change.
The board needs a solid fundation. If you’re listing Sample A above Sample B, the price change might flip their order. In other words, if you update rows by position, this could put Sample B’s price beside Sample A.
So make sure you match prices to permanent runner IDs instead. Each of the 2027 Kentucky Derby contenders should have a unique ID.
Here, the race is sample-race, with runners a and b. Treat version as an update number and increase it whenever you edit the data.
The page should accept version two after version one, then ignore version one if it arrives late. All names and prices below are fictional.
Save this as odds.json:
{
"raceId": "sample-race", "version": 1, "state": "open",
"runners": [
{"id": "a", "odds": "5/1"},
{"id": "b", "odds": "9/2"}
]
}
Get The Polling Version Working
Save the following as index.html beside that file. With Python installed, run python -m http.server 8000 –bind 127.0.0.1 from the folder, using Python’s local server, then open http://127.0.0.1:8000.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Sample odds</title>
<style>
table { width:100%; table-layout:fixed; }
thead th:last-child { width:8ch; }
td { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
#connection, #summary { min-height:3em; }
</style>
<table>
<caption>Sample fractional win odds</caption>
<thead><tr><th scope="col">Runner</th><th scope="col">Odds</th></tr></thead>
<tbody>
<tr><th scope="row">Sample A</th><td data-id="a">—</td></tr>
<tr><th scope="row">Sample B</th><td data-id="b">—</td></tr>
</tbody>
</table>
<button id="pause" type="button">Pause prices</button>
<p id="connection"></p>
<p id="summary" aria-live="polite" aria-atomic="true"></p>
<script>
const cells = new Map([...document.querySelectorAll('[data-id]')]
.map(cell => [cell.dataset.id, cell]));
const button = document.querySelector('#pause');
const connection = document.querySelector('#connection');
const summary = document.querySelector('#summary');
let latest = null, paused = false, closed = false, delay = 3000;
let changedAt = '', pending = new Set();
function draw(s) {
for (const r of s.runners) {
const cell = r && cells.get(r.id);
if (cell && typeof r.odds === 'string' && cell.textContent !== r.odds) {
cell.textContent = r.odds;
pending.add(r.id);
changedAt = new Date().toLocaleTimeString();
}
}
}
function accept(s) {
if (s.raceId !== 'sample-race' || !Number.isSafeInteger(s.version)
|| !Array.isArray(s.runners)) throw new Error('Invalid snapshot');
if (latest && s.version <= latest.version) return;
latest = s;
closed = s.state === 'closed';
if (!paused) draw(s);
}
async function poll() {
try {
const response = await fetch('odds.json', {
cache:'no-store', signal:AbortSignal.timeout(5000)
});
if (!response.ok) throw new Error('Fetch failed');
accept(await response.json());
connection.textContent = closed ? 'Updates closed' : 'Connected';
delay = 3000;
} catch {
connection.textContent = 'Updates delayed; keeping previous prices.';
delay = Math.min(delay * 2, 30000);
}
if (!closed) setTimeout(poll, delay);
}
button.onclick = () => {
paused = !paused;
button.textContent = paused ? 'Resume prices' : 'Pause prices';
pending.clear();
if (!paused && latest) draw(latest);
};
setInterval(() => {
if (!paused && pending.size) {
const n = pending.size;
summary.textContent = `${n} runner${n === 1 ? '' : 's'} updated at ${changedAt}.`;
pending.clear();
}
}, 10000);
poll();
</script>
</html>
So, the next request starts after the previous one finishes, following MDN’s polling guidance. Errors leave the previous prices visible and increase the retry delay. Setting state to closed in a newer snapshot stops polling.
Stop the Numbers From Moving the Page
Here’s a surprisingly annoying problem that’s quite easy to solve. A value changes from 9.8 to 10.2, the text becomes wider, and the layout moves.
That’s exactly the kind of thing Google’s layout-shift guidance recommends avoiding.
You can test this yourself by opening the demo and watching how the table behaves when prices change.
Pay attention to whether the rows move, especially when a number changes from something short like 8.5 to something longer like 12.75.

Don’t Make Screen Readers Narrate Every Number
Everything is easy to understand on paper, but that’s only when we compare two rows or two horses.
The real problem starts when most of the horses’ prices get updated every three seconds, while a screen reader tries to announce every change.
It becomes a total mess.
Instead of announcing every individual update, the example uses an aria-live=”polite” region to provide summaries every ten seconds.
This prevents the screen reader from constantly interrupting the user while still providing information about changes.
The Pause Prices button also stops visible updates and announcements, but incoming data continues to be cached in the background.
Final Thoughts
So, building a live odds board isn’t really about changing numbers quickly. That’s the easy part.
The difficult part is keeping the page readable and the information current without annoying everyone watching it. And fortunately, you can work most of that out with fictional data before connecting a real feed.