Skip to content

Function: copyTable()

ts
function copyTable(data, options?): Promise<boolean>;

Copies a 2-D data array to the clipboard as an HTML table with a TSV plain-text fallback.

Parameters

ParameterTypeDescription
data(string | number)[][]The table rows and cells.
options{ delimiter?: string; header?: boolean; }Formatting options.
options.delimiter?string-
options.header?boolean-

Returns

Promise<boolean>

true when the copy succeeded.

Example

ts
console.log(await copyTable([['Name', 'Age'], ['Alice', '30']]))

Since

1.0.0

Released under the MIT License.