File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -330,9 +330,12 @@ export class TableComponent extends ComponentBase {
330
330
}
331
331
332
332
// Find the targeted area
333
- let styleLeft = style . left + 1 ;
333
+ let headersOffset = this . state . headers === null ? 0 : 1 ;
334
+ let rowNumbersOffset = this . state . show_row_numbers ? 1 : 0 ;
335
+
336
+ let styleLeft = style . left + rowNumbersOffset ;
334
337
let styleWidth = style . width ;
335
- let styleTop = style . top === "header" ? 0 : style . top + 1 ;
338
+ let styleTop = style . top === "header" ? 0 : style . top + headersOffset ;
336
339
let styleHeight = style . height ;
337
340
338
341
// Apply the CSS to all selected cells
Original file line number Diff line number Diff line change 27
27
@t .final
28
28
@dataclass
29
29
class TableSelection :
30
+ _table : Table
31
+
30
32
_left : int
31
33
_top : int | t .Literal ["header" ]
32
34
_width : int
@@ -38,10 +40,14 @@ def style(
38
40
self ,
39
41
* ,
40
42
font_weight : t .Literal ["normal" , "bold" ] | None = None ,
41
- ) -> None :
43
+ ) -> Table :
44
+ # Store the passed in values
42
45
if font_weight is not None :
43
46
self ._font_weight = font_weight
44
47
48
+ # Return the table to allow chaining
49
+ return self ._table
50
+
45
51
def _as_json (self ) -> JsonDoc :
46
52
# Some values are always present
47
53
result : JsonDoc = {
@@ -543,6 +549,7 @@ def __getitem__(
543
549
544
550
# Construct the result
545
551
result = TableSelection (
552
+ _table = self ,
546
553
_left = left ,
547
554
_top = top ,
548
555
_width = width ,
You can’t perform that action at this time.
0 commit comments