About this set
An invoice table with column dividers you can drag, or focus and move with the arrow keys, to resize the Client, Status and Issued columns. Widths are written to col elements in a colgroup, and the table uses table-layout fixed, so every row follows the new width at once and long text is cut off with an ellipsis. Each divider is a 9 pixel wide handle on the right edge of its header, drawn as a thin indigo line on hover, while dragging and on keyboard focus. The dividers are focusable elements with role=”separator” and aria-valuenow, so screen readers announce the current width in pixels, and the left and right arrow keys change it by 12 pixels, or by 40 with Shift. Columns stay between 90 and 480 pixels, so none can be dragged away to nothing. On load the script pins each col to its rendered width, so the first drag or key press nudges a column instead of snapping it. Use it for admin tables where content widths vary, such as long client names or notes. Save the widths to local storage if they should persist.
What’s included
- Drag or arrow-key resizing, Shift for bigger steps
- Widths on a colgroup so all rows follow
- Focusable role="separator" dividers with aria-valuenow
- 90px minimum and 480px maximum per column
- Ellipsis for text that no longer fits
Accessibility
The caption explains how to resize. Each divider is a focusable role="separator" with aria-orientation, an aria-label naming its column, and aria-valuenow and aria-valuetext kept current in pixels. Dividers show an indigo line and a 2px outline on keyboard focus, and the line's colour transition is removed under prefers-reduced-motion.
Customise it
Change MIN, MAX and the 12 and 40 pixel steps in the script, the starting widths on the col elements, and the #4f46e5 divider colour in the .grip rules (plain CSS and Bootstrap) or the after: utilities on each divider (Tailwind).




















