-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix normalisation and First Column issues #2657
Changes from 9 commits
b17600c
1bb9fd6
65db400
3cf7d5a
22e878b
d1df4ff
a1d438f
2b073b6
1667bce
8196344
2d7d896
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,7 +208,7 @@ function formatCells( | |
// Format Background Color | ||
if (!metaOverrides.bgColorOverrides[rowIndex][colIndex]) { | ||
let color: string | null | undefined; | ||
if (hasFirstColumn && colIndex == 0) { | ||
if (hasFirstColumn && colIndex == 0 && rowIndex > 0) { | ||
color = null; | ||
} else { | ||
color = | ||
|
@@ -239,7 +239,7 @@ function formatCells( | |
} | ||
|
||
/** | ||
* Set the first column format borders for the table | ||
* Set the first column format borders for the table as well as header property | ||
* @param rows The rows of the table | ||
* @param format The table metadata format | ||
*/ | ||
|
@@ -261,6 +261,7 @@ export function setFirstColumnFormatBorders( | |
|
||
switch (rowIndex) { | ||
case 0: | ||
cell.isHeader = false; | ||
break; | ||
case 1: | ||
setBorderColor(cell.format, 'borderBottom'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not relate to this change, but I realize that it is possible there are only 2 rows, in that case, "1" is the same with "rows.length-1", but then there are different handling. Is that ok? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, they should be flipped in order. The order should be row 0, then last row, then row 1, and then any other row. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the cell was header? This will set it to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the idea is that First Column does not apply to the first cell, at least that is the behaviour we implemented and I am just restoring it.
However I noticed that this can conflict with hasHeaderRow, so I made a change to apply the header status accordingly.
cell.isHeader = !!format.hasHeaderRow;