Skip to content

Instantly share code, notes, and snippets.

<style>
.wrap {
max-width: 640px; max-height: 320px;
overflow: auto; border: 1px solid #ddd;
}
table { border-collapse: separate; border-spacing: 0; width: max-content; }
th, td { border-bottom: 1px solid #eee; border-right: 1px solid #f6f6f6; white-space: nowrap; padding: 8px 12px; }
thead th { background: #fafafa; font-weight: 600; position: sticky; top: 0; z-index: 4; }
/* 固定列に付ける共通クラス */
.sticky-col { position: sticky; background: #fff; z-index: 3; box-shadow: 1px 0 0 #eaeaea; }