Hi
I'm writing a small macro to create a table. The idea behind the macro is that I'll receive the number of columns as a parameter and work from there.
So far I've been able to create the first line of the table, but I haven't found a way to add a line break and to add the second row of the table:
/*\
title: TrxMacro2
type: application/javascript
module-type: macro
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "trxmacro";
exports.params = [
{name: "columns"}
];
/*
Run the macro
*/
exports.run = function(columns) {
var ret+="|";
var i;
for(i=0; i < columns; i++) {
ret+=" column "+(i+1) + " |";
}
ret+="\n";
return ret;
};
})();
How can I add a linebreak to the return of my macro?
Thanks,