diff --git a/resources/elcode_english.html b/resources/elcode_english.html index d36a0710..92ded8da 100755 --- a/resources/elcode_english.html +++ b/resources/elcode_english.html @@ -252,6 +252,46 @@ to produce
Other possibilities are [list=A] for capital letters and [list=I] for Roman numbering.
+
+
+[table border="1"]
+One|Two
+|-
+Three|Four
+[/table]
+
+ +to produce
+ +
| One | Two |
| Three | Four |
+ +The parameters after [table ...] are directly used in the HTML <table> +tag. To increase the cell padding, on can add for example
+
+[table border="1" cellpadding="20"]
+One|Two
+|-
+Three|Four
+[/table]
+
+ +to produce
+ +
| One | Two |
| Three | Four |
+ +Table headings are not supported, but can be simulated by embedding the cell +contents with a [B]...[/B] tag.
+
diff --git a/scripts/elcode.js b/scripts/elcode.js index f57cfa77..86861275 100755 --- a/scripts/elcode.js +++ b/scripts/elcode.js @@ -57,6 +57,8 @@ function elcode1(text, tag, value, selection) str = selection + value; else if (tag == 'LIST') str = '[LIST]\r\n[*] ' + selection + '\r\n[/LIST]'; + else if (tag == 'TABLE') + str = '[TABLE border="1"]\r\nA|B\r\n|-\r\nC|D\r\n[/TABLE]'; else if (value == '') str = '['+tag+']' + selection + '[/'+tag+']'; else diff --git a/src/elogd.c b/src/elogd.c index 23408cc7..dc710f7e 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -5706,6 +5706,13 @@ PATTERN_LIST pattern_list[] = { {"[/quote]\r", "
"},
+ {"[table ", "
\r\n"); j += 8; } else { @@ -9840,6 +9863,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf(" "); ricon("quote", loc("insert quote"), "elcode(document.form1.Text, 'QUOTE','')"); ricon("list", loc("insert list"), "elcode(document.form1.Text, 'LIST','')"); + ricon("table", loc("insert table"), "elcode(document.form1.Text, 'TABLE','')"); ricon("heading", loc("insert heading"), "queryHeading(document.form1.Text)"); rsprintf(" "); |