Skip to content

Commit

Permalink
✨ Added headerAlign prop
Browse files Browse the repository at this point in the history
  • Loading branch information
mationai committed Jan 21, 2022
1 parent e467d27 commit a91ab17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ gamalielmendez's fork added:
This fork added/fixed:
- Render "" instead of "undefined" if no data
- Changed `on:change` to `on:blur` per warning message
- Added tableWidth prop, allow last column to have auto width (overriding width settings for last col)
- Added `tableWidth` prop, allow last column to have auto width (overriding width settings for last col)
- Fixed input loses focus
- Added debounce
- Fixed dispatch
- Added align prop
- Added `align` prop
- Added `headerAlign` prop to override default header cell 'center' text-align
- Lighter border colors
- Added onCellUpdate and onHeaderUpdate (see usage below)
- Added `onCellUpdate` and `onHeaderUpdate` (see usage below)

## [Demo](https://bsssshhhhhhh.github.io/svelte-data-grid-demo/)
### [Demo repo](https://github.com/bsssshhhhhhh/svelte-data-grid-demo)
Expand Down
15 changes: 9 additions & 6 deletions src/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1072,12 +1072,15 @@
{#if !column.disallowResize}
<div
class="grid-cell-size-capture"
style="left: {getCellLeft({
i: i + 1,
columnWidths,
__affixedColumnIndices,
__scrollLeft
}) - Math.floor(__columnHeaderResizeCaptureWidth / 2)}px; width: {__columnHeaderResizeCaptureWidth}px;"
style="
left: {getCellLeft({
i: i + 1,
columnWidths,
__affixedColumnIndices,
__scrollLeft
}) - Math.floor(__columnHeaderResizeCaptureWidth / 2)}px;
width: {__columnHeaderResizeCaptureWidth}px;
text-align: {column.headerAlign || 'center'};"
on:mousedown={event => onColumnResizeStart(event, i)} />
{/if}
{/each}
Expand Down

0 comments on commit a91ab17

Please sign in to comment.