When you ask the chat at Octolane for your open deals, the answer is a table. For a long time that table was markdown. The model typed pipe characters, and the chat turned them into a table as they arrived.
In a screenshot, it looked fine. Then I actually started using it, and the cracks showed up one after another. The copy button sat on top of the cells. The table fell apart on my phone. It jumped around while the reply streamed. And it couldn't sort, filter, or even tell me how many rows it was hiding. Here's how I ended up replacing it with a real table, and the tool that feeds it.
The old table
I started where every markdown table ended up, a component called CopyableTable. It wrapped the table in a scroll box, capped each cell at 25 characters so long text would wrap, and stuck a copy button in the top right corner.
I always start with whatever covers the content, and that button did. It sat on top of the table instead of beside it, so it covered the header of the last column, and the edge fades washed right into it. A control shouldn't sit on the data it acts on, so I gave it a row of its own.
| Deal | Account | Stage | Value | Next step |
|---|---|---|---|---|
| Platform renewal | Northwind | Negotiation | $84,000 | Send redlines |
| 20 seats | Fabrikam | Trial | $18,500 | Check trial usage |
| New business | Contoso | Demo | $42,000 | + add legal review |
| EMEA expansion | Tailspin | Lead | — | Find the budget owner |
While it streamed
Streaming came next. Replies arrive a few characters at a time, and the markdown gets parsed again on every update. But markdown only knows a table is a table once the line of dashes under the header shows up. Until then, I was staring at a paragraph of pipes.
And when the table finally appeared, it measured its width once, from whatever first row or two it had. It watched the chat area, not the table, so later rows never changed it. A long row that came in later had to wrap, or scroll, inside a box sized for short ones. That's also why the same table came out wider after a reload: it measured again, with every row in place.
Three deals are open in EMEA this quarter. Northwind's renewal is the largest, and it's already in negotiation.
| Deal | Account | Stage | Value |
|---|---|---|---|
| Renewal | Northwind | Negotiation | $84,000 |
| 20 seats | Fabrikam | Trial | $18,500 |
| New business with the analytics add-on for the whole EMEA team | Contoso Pharmaceuticals International | Demo | $42,000 |
Why patching stopped working
I patched it first, one pull request at a time. Each patch fixed a symptom, and the cause stayed underneath.
A markdown table is only strings. It has no column types, so money can't be formatted as money or sorted as a number. It has no row count, so it can't tell you it's showing 20 of 1,240. And it arrives a character at a time, so its shape keeps changing while you look at it. No amount of patching fixes that. So I closed the pull request, and the table became a tool.
The plan in the ticket
The ticket asked for a real table component, with search, filters, sorting and CSV export. My first sketch was a new kind of message part, with headers and a category for every kind of cell.
The core idea held up: the table travels as its own part, not as text. The shape didn't. I moved the types off the cells and onto the columns, reusing the field types the CRM already has. Then I added a few fields that only start to matter once a table gets big:
Layout isn't in there, on purpose. The frontend decides how to show the table. The backend never sends a layout hint.
One tool, three row sources
Instead of typing pipes, the model now calls render_table. The cheapest way to call it is to point at a search it already ran this turn. Those rows are already sitting on the server, so the model never retypes them, which means it can't get one wrong.
Some results are too big to send back inline, or come from a sub-agent, so I added a second source for those: a handle to a dataset held on the server. Only when neither fits, say a comparison the model pieced together from the web or the conversation, does it pass the rows itself.
Rows out of band
Then there was context. Whatever a tool returns gets shown to the model again on every step after it. Put the rows in that return value, and they eat context for the rest of the turn. Worse, a 500-row table crosses the size limit for tool results. When that happens, the whole result gets swapped for a short stub, and no table renders at all. On exactly the tables the cap exists for.
The way out was to keep the rows away from the model entirely. The tool hands it an envelope with no rows, and keeps the full payload on the turn. When the stream gets turned into parts, the rows slip back in.
Model asks for a table
RunningNot a Markdown table: it points at the search it already ran
Server builds the table
RunningKeeps up to 500 rows, counts the real total, gives each column a type
Model gets a summary
RunningThe title, column names and row count. No rows at all
Model writes the reply
RunningIts memory holds the summary, never the whole table
What the model sees
Full rows sent to you
RunningThe full rows travel with the reply, out of the model's sight
Columns set up by type
RunningEach header knows what it holds: money, a date, a stage
Each cell drawn by type
RunningNames become links, amounts read as money, stages as chips
What you see
A row count you can trust
The table ships at most 500 rows, and its count is always the true total. Count the sliced array instead, and it'll happily tell you 500 of 500 when there are 1,240. That's a number said with total confidence, and it's wrong.
I also marked the rows as coming in the order they were produced, not ranked. That one little field ended up shaping the design later, because sorting 500 rows out of 1,240 doesn't find you the top deal.
Headers people can read
The first tables came back with headers like sent_at. One had a column called # holding 1 to 15, a copy of the row numbers the table already draws. The prompt had rules for column types and titles, and nothing about labels.
So I wrote one: labels a person would say out loud, in Title Case, never a raw field key and never a # column. Then I put it in three places, the system prompt, the tool description and the field's schema, so it holds no matter which one the model is reading.
No more pipe tables
Even with the tool in place, some answers still came back as markdown. A pricing comparison gave it away. The cause was four older parts of the prompt that still invited a markdown table, one of them on every single turn. A comparison matched those better than it matched the ban. And background turns, where sub-agents write their summaries, had never gotten the rule at all.
Rewording the ban wouldn't have fixed that. Instead I deleted the lines it was fighting with, gave background turns the rule, and spelled out the exact habit to stop:
Slack got to stay the exception. It has no widgets, and it shows markdown tables well, so it keeps them.
One table, always inline
The ticket pictured a small card in the chat that opens the table in a side panel. My first version shipped half of that: small, complete tables inline, everything else as a card. The card showed a title, a few column names and a row count. It described a table, in the space where the table would have fit, and then made you click to see it.
I want a preview to be the content itself, so I dropped the card. Every table renders inline now, and the long ones offer the panel. I kept search, filter and sort out of the inline table on purpose. It shows the first five rows in the order they came, and sorting those would look like a ranking of the whole table. Anything that reorders lives in the panel, which has room to say what it applied to.
Rows and columns that say what they are
Above the table, I added one line in muted type: how many rows you're looking at, out of how many, and how many columns. The prose around it already tells you what the table is about. What it can't tell you is how much of it you're seeing.
Show more
My first “Show all” button sat under a table that ended on a clean bottom border. The edge said this is the whole table. The button said it wasn't.
So I had the preview render two rows past the five, and cut the frame right through the middle of the last one. Nobody mistakes a half-cut row for the last row. Then I floated the button over the fade.
Deal | Account | Contact | Deal Owner | Stage | Deal Value | Close Date | Next Step |
|---|---|---|---|---|---|---|---|
Platform renewal | Northwind | Nora Blake | Priya Shah | Negotiation | $84,000 | Dec 4, 2026 | Send redlines |
20 seats | Fabrikam | Omar Haddad | Leo Martin | Trial | $18,500 | Dec 11, 2026 | Check trial usage |
New business | Contoso | Ines Duarte | Ana Ruiz | Demo | $42,000 | Dec 19, 2026 | + add legal review |
EMEA expansion | Tailspin | Kai Moreno | Priya Shah | Lead | — | Jan 8, 2027 | Find the budget owner |
Analytics add-on | Litware | Ruth Adeyemi | Sam Okafor | Won | $9,600 | Nov 28, 2026 | Hand off to onboarding |
Those two extra rows are pure decoration, so I hid them from screen readers and made sure they can't be focused. The caption still says five, because nobody can actually read them.
Fades as masks
The fades started out as gradients painted over the content, in a colour meant to match the background. I tried three colours. None of them looked right, because the gradient also covered the frame's border and its rounded corners. The problem was the technique, not the colour.
I pulled every open deal from the pipeline, 500 in all. Four of the first five close before the end of the year, and together those five come to a little over $150,000. Northwind’s renewal is the one to watch: it’s the largest, and it’s already in negotiation. Here’s the list, with the owner, stage and next step for each deal.
Deal | Account | Contact | Deal Owner | Stage | Deal Value | Close Date | Next Step |
|---|---|---|---|---|---|---|---|
Platform renewal | Northwind | Nora Blake | Priya Shah | Negotiation | $84,000 | Dec 4, 2026 | Send redlines |
20 seats | Fabrikam | Omar Haddad | Leo Martin | Trial | $18,500 | Dec 11, 2026 | Check trial usage |
New business | Contoso | Ines Duarte | Ana Ruiz | Demo | $42,000 | Dec 19, 2026 | + add legal review |
EMEA expansion | Tailspin | Kai Moreno | Priya Shah | Lead | — | Jan 8, 2027 | Find the budget owner |
Analytics add-on | Litware | Ruth Adeyemi | Sam Okafor | Won | $9,600 | Nov 28, 2026 | Hand off to onboarding |
Want me to draft a nudge for the Fabrikam deal still in trial, or find a budget owner for Tailspin?
So I switched to a mask. A mask fades the content itself, so there's no colour to pick at all. One catch: an element only gets one mask image, so two classes for two directions just replace each other. I ended up with one class that stacks both gradients, and keeps a pixel only where both keep it:
Each edge follows its own scroll position and stays out of the way until that direction overflows, so a table that fits gets no fade at all. I made the bottom fade deeper than the sides. It has to bury whole rows, while the sides only have to hint that the row keeps going.
The panel
“Show all” opens the side panel, and that's where all the tools went. Search marks matches in place, with a counter and arrows to step through them. It doesn't hide the other rows, because the rows around a match are what give it meaning. Narrowing is the filters' job, and they reuse the CRM's own filter operators, so a date column offers date operators.
The header always says how much it holds, 500 of 1,240 rows. In the product, the moment you sort, a note says it more firmly: these are sorted within the first 500, not ranked across the full set.
1 | Platform renewal | Northwind | Nora Blake | Priya Shah | Negotiation | $84,000 | Dec 4, 2026 | Send redlines |
2 | 20 seats | Fabrikam | Omar Haddad | Leo Martin | Trial | $18,500 | Dec 11, 2026 | Check trial usage |
3 | New business | Contoso | Ines Duarte | Ana Ruiz | Demo | $42,000 | Dec 19, 2026 | + add legal review |
4 | EMEA expansion | Tailspin | Kai Moreno | Priya Shah | Lead | — | Jan 8, 2027 | Find the budget owner |
5 | Analytics add-on | Litware | Ruth Adeyemi | Sam Okafor | Won | $9,600 | Nov 28, 2026 | Hand off to onboarding |
6 | Multi-year | Coho Winery | Theo Okoro | Mei Lin | Lead | $43,500 | Dec 12, 2026 | Book a call |
7 | Multi-year | Wide World | Jonas Grant | Ana Ruiz | Trial | $73,500 | Nov 27, 2026 | Follow up after the demo |
8 | Seat expansion | Alpine Ski | Lena Okoro | Mei Lin | Demo | $11,500 | Jan 30, 2027 | Follow up after the demo |
9 | Seat expansion | Proseware | Iris Chen | Mei Lin | Lead | $55,500 | Feb 4, 2027 | Book a call |
10 | Pilot | Humongous | Theo Patel | Priya Shah | Negotiation | $32,500 | Dec 1, 2026 | Share the case study |
11 | Renewal | Blue Yonder | Zara Okoro | Sam Okafor | Demo | $105,500 | Dec 22, 2026 | Share the case study |
12 | Multi-year | Alpine Ski | Lena Okoro | Priya Shah | Demo | $71,500 | Dec 25, 2026 | Wait on security review |
13 | Seat expansion | Proseware | Iris Chen | Priya Shah | Negotiation | $17,500 | Dec 6, 2026 | Share the case study |
14 | Multi-year | Fourth Coffee | Jonas Patel | Ana Ruiz | Negotiation | $60,500 | Jan 26, 2027 | Wait on security review |
15 | Multi-year | Lucerne | Theo Lindqvist | Mei Lin | Demo | $114,500 | Jan 30, 2027 | Follow up after the demo |
16 | New business | Lucerne | Theo Lindqvist | Mei Lin | Negotiation | $61,500 | Dec 9, 2026 | Follow up after the demo |
Then I pinned the first column while you scroll sideways, with a soft shadow once something slides under it. With collapsed borders, the table paints the borders itself, so the pinned column's divider got left behind when the cells moved. So the table uses separate border mode.
Export writes a CSV, and that needs a guard. Rows can hold web results, or text someone else typed into the CRM, and a cell like =HYPERLINK(…) runs the moment the file is opened. So those cells get a leading apostrophe. Numbers I left alone, otherwise a column of negative amounts would stop adding up.
The old table, on a phone
One problem from the old table is still open: the phone. The chat reads in a narrow column, and wide tables used to break out of it to use the whole chat area. To pull that off, the component measured the table in JavaScript, set a width in pixels, and dragged it left with a negative margin to keep it centred.
On a phone, though, there's nothing to break out into. The table scrolled sideways inside the message, with most of its columns hidden behind a fade. The copy button landed on whatever header happened to be under it. Long cells still wrapped at 25 characters, so rows grew tall, and a height cap gave the table its own vertical scroll, inside the chat's. Two scrolls, one inside the other.
Five deals close before the end of the year. Northwind is the biggest and still in negotiation.
| Deal | Account | Stage | Why it matters |
|---|---|---|---|
| Platform renewal | Northwind | Negotiation | Largest renewal this year, legal is reviewing the new terms |
| 20 seats | Fabrikam | Trial | Usage doubled in the second week of the trial |
| New business | Contoso | Demo | Champion moved teams, need a new sponsor |
| EMEA expansion | Tailspin | Lead | Budget owner not identified yet |
| Analytics add-on | Litware | Won | Signed, waiting on the onboarding kickoff |
| Multi-year | Coho Winery | Lead | Asked for a security review before pricing |
| Multi-year | Wide World | Trial | Wants a two-year term with a discount |
| Seat expansion | Alpine Ski | Demo | Pilot ends this month, decision expected after |
Want me to draft the redlines for Northwind?
Markdown table
Five deals close before the end of the year. Northwind is the biggest and still in negotiation.
Deal | Account | Contact | Deal Owner | Stage | Deal Value | Close Date | Next Step |
|---|---|---|---|---|---|---|---|
Platform renewal | Northwind | Nora Blake | Priya Shah | Negotiation | $84,000 | Dec 4, 2026 | Send redlines |
20 seats | Fabrikam | Omar Haddad | Leo Martin | Trial | $18,500 | Dec 11, 2026 | Check trial usage |
New business | Contoso | Ines Duarte | Ana Ruiz | Demo | $42,000 | Dec 19, 2026 | + add legal review |
EMEA expansion | Tailspin | Kai Moreno | Priya Shah | Lead | — | Jan 8, 2027 | Find the budget owner |
Analytics add-on | Litware | Ruth Adeyemi | Sam Okafor | Won | $9,600 | Nov 28, 2026 | Hand off to onboarding |
Want me to draft the redlines for Northwind?
Table widget
Streaming, and phones, again
With all that in, I went back to the two problems I started with, streaming and the phone. Both were fixed, for the same reason. The table doesn't come from text anymore, so there's nothing half-written to render. The reply streams its prose, and then the table arrives as one part with all its rows, fading in after the words before it.
And nothing gets measured anymore. The frame is the full width of the message, its corners on the same margins as the text, and a wide table scrolls inside it. A frame pinned to its parent can't overshoot anything, on a phone or anywhere else.
What I'd keep
Give data its own part. Text that has to be parsed while it streams will look broken while it streams.
Keep big payloads away from the model, and keep the true count with them. A number that's confidently wrong is worse than no number.
When a prompt rule doesn't hold, look for the lines it's competing with before you reword it.
And when no colour looks right, check the technique. Here the fade was the bug, not its colour.
A prompt to build your own
If your chat streams Markdown tables and you want the same thing, here's the prompt I'd hand an agent. It only covers behaviour. How it looks comes from your own design system and theme.