html { font-family: sans-serif; font-size: 14px; } * { box-sizing: border-box; } table { border: 1px solid lightgray; border-collapse: collapse; border-spacing: 0; } tbody { border-bottom: 1px solid lightgray; } th { border-bottom: 1px solid lightgray; border-right: 1px solid lightgray; padding: 2px 4px; } td { border-right: 1px solid lightgray; padding: 2px 4px; } tfoot { color: gray; } tfoot th { font-weight: normal; } button:disabled { opacity: 0.5; cursor: not-allowed; } /* Demo layout helpers for the plain example UI. */ .demo-root { padding: 0.5rem; } .spacer-xs { height: 0.25rem; } .spacer-sm { height: 0.5rem; } .spacer-md { height: 1rem; } .controls, .button-row, .inline-controls, .filter-row, .page-controls { display: flex; align-items: center; } .button-row { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; } .controls, .page-controls { gap: 0.5rem; flex-wrap: wrap; } .inline-controls { gap: 0.25rem; } .filter-row { gap: 0.5rem; } .header-button { padding: 0; border: 0; color: inherit; font: inherit; background: transparent; } .sortable-header { cursor: pointer; user-select: none; } .column-toggle-panel { display: inline-block; border: 1px solid #000; border-radius: 0.25rem; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); } .column-toggle-panel-header { border-bottom: 1px solid #000; padding: 0 0.25rem; } .column-toggle-row { padding: 0 0.25rem; } .demo-button, .page-size-input, .filter-input { border: 1px solid currentColor; border-radius: 0.25rem; } .demo-button { padding: 0.5rem; } .demo-button-sm { padding: 0.25rem; } .page-size-input { width: 4rem; padding: 0.25rem; } .filter-input { width: 6rem; } td { border-right: 1px solid lightgray; padding: 2px 4px; } td:last-child { border-right: 0; } /* Cell selection: a dragged rectangle is tinted, and each cell draws only the sides that getSelectionEdges() reports as the boundary of the selection, so any union of rectangles ends up with a single continuous outline. The outline is drawn with inset box-shadows rather than borders. On a border-collapse table a thicker border widens the shared grid line, which would make rows change height as cells become selected; box-shadow never affects layout. Each side is its own custom property so the four edge classes compose, which they could not do if each set `box-shadow` directly. */ .cell-selectable { user-select: none; cursor: cell; --cell-edge-top: 0 0 0 0 transparent; --cell-edge-right: 0 0 0 0 transparent; --cell-edge-bottom: 0 0 0 0 transparent; --cell-edge-left: 0 0 0 0 transparent; box-shadow: inset var(--cell-edge-top), inset var(--cell-edge-right), inset var(--cell-edge-bottom), inset var(--cell-edge-left); } .cell-selected { background: #dbeafe; } .cell-focused { background: #bfdbfe; } .cell-edge-top { --cell-edge-top: 0 2px 0 0 #2563eb; } .cell-edge-right { --cell-edge-right: -2px 0 0 0 #2563eb; } .cell-edge-bottom { --cell-edge-bottom: 0 -2px 0 0 #2563eb; } .cell-edge-left { --cell-edge-left: 2px 0 0 0 #2563eb; }