Skip to content

Commit

Permalink
docs: setCellFormatByRange
Browse files Browse the repository at this point in the history
Add example to the docs how to use setCellFormatByRange
  • Loading branch information
igeligel authored and zyc9012 committed Dec 19, 2023
1 parent 3a0a0ad commit e503818
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,30 @@ Like `setCellFormat`, but set multiple cell formats in one shot.
| range | { row: number[], column: number[] } | range of cells to be set |
| [options] | [CommonOptions](#commonoptions) | common options |

Example:

```tsx
import { Workbook, WorkbookInstance } from "@fortune-sheet/react";

const ExampleComponent = () => {
const ref = useRef < WorkbookInstance > null;

useEffect(() => {
// Sets A1:C3 to use the Arial font.
ref.current?.setCellFormatByRange("ff", "Arial", {
column: [0, 2],
row: [0, 2],
});
}, []);

return (
<>
<Workbook ref={ref} />
</>
);
};
```

---

### mergeCells
Expand Down

0 comments on commit e503818

Please sign in to comment.