From 9c3ea1319a5792bb2be2119b99c3659d3a886810 Mon Sep 17 00:00:00 2001 From: SpencerPark Date: Mon, 22 Oct 2018 11:35:48 -0400 Subject: [PATCH] Default to right table alignment but allow table local overrides --- notebook/static/notebook/js/outputarea.js | 3 ++- notebook/static/notebook/js/textcell.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/notebook/static/notebook/js/outputarea.js b/notebook/static/notebook/js/outputarea.js index 3cdf23316..da72caa5e 100644 --- a/notebook/static/notebook/js/outputarea.js +++ b/notebook/static/notebook/js/outputarea.js @@ -732,7 +732,8 @@ define([ var renderer = new marked.Renderer(); renderer.tablecell = function (content, flags) { var type = flags.header ? 'th' : 'td'; - var start_tag = '<' + type + '>'; + var style = flags.align == null ? '': ' style="text-align: ' + flags.align + '"'; + var start_tag = '<' + type + style + '>'; var end_tag = '\n'; return start_tag + content + end_tag; }; diff --git a/notebook/static/notebook/js/textcell.js b/notebook/static/notebook/js/textcell.js index 68124403c..cb96faedf 100644 --- a/notebook/static/notebook/js/textcell.js +++ b/notebook/static/notebook/js/textcell.js @@ -395,7 +395,8 @@ define([ var renderer = new marked.Renderer(); renderer.tablecell = function (content, flags) { var type = flags.header ? 'th' : 'td'; - var start_tag = '<' + type + '>'; + var style = flags.align == null ? '': ' style="text-align: ' + flags.align + '"'; + var start_tag = '<' + type + style + '>'; var end_tag = '\n'; return start_tag + content + end_tag; };