Sticky Sidebar Example .table-container { display: block; max-width: 300px; max-height: 400px; /* 根据需要调整 */ overflow: auto; } .header-row { display: flex; position: sticky; top: 0; background-color: #f8f8f8; z-index: 1; } .header-cell, .cell { min-width: 80px; padding: 8px; border: 1px solid #ddd; } .header-cell { font-weight: bold; } .cell-fixed { position: sticky; left: 0; background-color: #f8f8f8; z-index: 1; } .table-body { display: block; } .row{ display: flex; } Header 1 Header 2 Header 3 Header 4 Header 5 Header 6 Header 7 Row 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7 左右滑动时可以粘住在左边,但是左右滚动超过300px就不粘住了,求解