Skip to content

Instantly share code, notes, and snippets.

@njjerrysmith
njjerrysmith / mdTableGenerator.js
Last active January 17, 2022 22:44
TextExpander Javascript Markdown Table Generator
var rows = Number(%filltext:name=bodyrows:default=2:width=5%); //body of table rows
var cols = Number(%filltext:name=cols:default=4:width=5%); //columns of table
var rows = rows + 2; //add a rows to account for header and seperator
var text = ''; //variable to store the output
for (rCount = 1; rCount <= rows; rCount++) {
for (cCount = 1; cCount <= cols; cCount++) {
if (rCount == 1) { // Header Row Output
if (cCount == 1) {
text += '**%|** |';