This commit is contained in:
Mackie 2026-06-08 08:31:32 +08:00
parent 8983a443a5
commit 9ba5e4e3d4
2 changed files with 17 additions and 8 deletions

View file

@ -20,22 +20,28 @@
width: 100%; width: 100%;
} }
/* The container for the absolute positioning */
.row { .row {
position: absolute; /* Required for virtualization */ position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
padding: 0 1rem;
box-sizing: border-box;
border-bottom: 1px solid #2d3748;
}
/* The actual grid that forces alignment */
.row-inner {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
padding: 0 1rem;
align-items: center; align-items: center;
border-bottom: 1px solid #2d3748; height: 100%;
box-sizing: border-box;
} }
.price-cell { .price-cell {
text-align: right; text-align: right;
font-family: 'Courier New', Courier, monospace; /* Monospace keeps price digits aligned */ font-family: 'Courier New', Courier, monospace;
} }
/* Ensure the price text is right-aligned to match professional dashboards */ /* Ensure the price text is right-aligned to match professional dashboards */

View file

@ -29,10 +29,13 @@ export default function App() {
className="row" className="row"
style={{ transform: `translateY(${virtualRow.start}px)` }} style={{ transform: `translateY(${virtualRow.start}px)` }}
> >
<span>{data[virtualRow.index].symbol}</span> <div className="row-inner">
<span className="price-cell">${data[virtualRow.index].price}</span> <span>{data[virtualRow.index].symbol}</span>
<span className="price-cell">${data[virtualRow.index].price}</span>
</div>
</div> </div>
))} </div> ))}
</div>
</div> </div>
</div> </div>
); );