diff --git a/src/views/TableEditor.tsx b/src/views/TableEditor.tsx index 76eae2f..d5993d9 100644 --- a/src/views/TableEditor.tsx +++ b/src/views/TableEditor.tsx @@ -1,3 +1,4 @@ +import { table } from "console"; import { useApp, usePlugin } from "context/hooks"; import { Notice, MarkdownView } from "obsidian"; import * as React from "react"; @@ -155,6 +156,16 @@ export const TableEditor = ({ leafId, cursor, inputData, updateViewData, supress return table; } + const addRow = () => { + const newValues = [...values, Array(values[0].length).fill('')]; + setValues(newValues); + } + + const addCol = () => { + const newValues = values.map(row => [...row, '']); + setValues(newValues); + } + return ( <>
@@ -166,6 +177,10 @@ export const TableEditor = ({ leafId, cursor, inputData, updateViewData, supress
+
+ + +