Skip to content

Commit cc0223f

Browse files
authored
Merge pull request #21 from DHTMLX/styled-border-for-cells-3792
[add] styled cells borders section into user guide, update related docs
2 parents db61955 + 1cf45bf commit cc0223f

6 files changed

+31
-7
lines changed

docs/api/spreadsheet_parse_method.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ A CSS class is set for a cell via the **css** property.
253253

254254
### List of properties
255255

256-
The list of properties you can specify in the **style** object:
256+
The list of properties you can specify in the **styles** object:
257257

258258
- *background*
259259
- *color*
@@ -263,6 +263,7 @@ The list of properties you can specify in the **style** object:
263263
- *fontWeight*
264264
- *fontStyle*
265265
- *multiline: "wrap"* (from v5.0.3)
266+
- *border*, *border-right*, *border-left*, *border-top*, *border-bottom* (from v5.2)
266267

267268
:::note
268269
You may also use the following properties if needed:

docs/api/spreadsheet_setstyle_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ setStyle(cell: string, styles: array | object): void;
2323
### Parameters
2424

2525
- `cell` - (required) the id(s) of a cell(s) or a range of cells
26-
- `style` - (required) styles that should be applied to cells. [Check the list of properties which you can use to style cells](api/spreadsheet_parse_method.md#list-of-properties)
26+
- `styles` - (required) styles that should be applied to cells. [Check the list of properties which you can use to style cells](api/spreadsheet_parse_method.md#list-of-properties)
2727

2828
### Example
2929

docs/assets/clear_cells_border.png

22.1 KB
Loading

docs/assets/styled_cell_border.png

19.4 KB
Loading

docs/data_formatting.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,22 @@ To clear styles applied to data in a cell, or values entered into cells, or remo
9191
- Right-click the selection to call the context menu.
9292
- Choose the **Clear** option and then select one of the options in the drop-down list:
9393

94-
![Clear option](assets/clear_option.png)
94+
![Clear option](assets/clear_option.png)
95+
96+
## Styled borders for cells
97+
98+
You can add a styled border(s) for a cell or a group of cells.
99+
100+
### Setting styled borders
101+
102+
- Select the necessary cell or a group of cells to set a styled border(s) for
103+
- Click the **Border** button in the toolbar and choose the desired type of border, its color and style
104+
105+
![Styled border](assets/styled_cell_border.png)
106+
107+
### Removing styled borders
108+
109+
- Select the necessary cell or a group of cells from which you want to remove styled borders
110+
- Click the **Border** button in the toolbar and choose the *Clear borders* option
111+
112+
![Clear border](assets/clear_cells_border.png)

docs/working_with_cells.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ spreadsheet.setValue("B6,A1:D1",5);
2626
spreadsheet.setValue("A1:D1",[1,2,3]);
2727
~~~
2828

29-
{{note Please note that the method allows setting the same/repeated value(s) for the specified cells. In case you want to add different values into spreadsheet cells, you'd better use the [](api/spreadsheet_parse_method.md) method.}}
29+
:::note
30+
Please note that the method allows setting the same/repeated value(s) for the specified cells. In case you want to add different values into spreadsheet cells, you'd better use the [`parse()`](api/spreadsheet_parse_method.md) method.
31+
:::
32+
3033

3134
### Get values
3235

@@ -57,7 +60,7 @@ spreadsheet.setValidation("B10:B15", ["Apple", "Mango", "Avocado"]);
5760
The drop-down list will limit the choice of the end user. It will show the *Invalid value* message when the user completes a cell with an unexpected value.
5861

5962
:::info
60-
The [](api/spreadsheet_setvalidation_method.md) method can also remove validation from the specified cells. [Check the details](../api/spreadsheet_setvalidation_method/#details).
63+
The [`setValidation()`](api/spreadsheet_setvalidation_method.md) method can also remove validation from the specified cells. [Check the details](../api/spreadsheet_setvalidation_method/#details).
6164
:::
6265

6366
## Inserting a hyperlink into a cell
@@ -85,7 +88,7 @@ spreadsheet.insertLink("A2");
8588
You can apply certain styling to a cell or a range of cells via the [](api/spreadsheet_setstyle_method.md) method. It takes two parameters:
8689

8790
- **cells** - (*string*) the id(s) of a cell(s) or a range of cells
88-
- **style** - (*object/array*) styles that should be applied to cells
91+
- **styles** - (*object/array*) styles that should be applied to cells
8992

9093
~~~jsx
9194
// setting style for one cell
@@ -98,7 +101,9 @@ spreadsheet.setStyle("B6,A1:D1", {color: "blue"});
98101
spreadsheet.setStyle("A1:D1", [{color: "blue"}, {color: "red"}]);
99102
~~~
100103

101-
{{note The method allows setting the same style for the specified cells. In case you want to apply different styles to spreadsheet cells, you'd better use the [](api/spreadsheet_parse_method.md) method.}}
104+
:::note
105+
The method allows setting the same style for the specified cells. In case you want to apply different styles to spreadsheet cells, you'd better use the [`parse()`](api/spreadsheet_parse_method.md) method.
106+
:::
102107

103108
### Get styles
104109

0 commit comments

Comments
 (0)