Add title attribue if table cell title is very long
Change-Id: Icfe1f3838fca2afa27b14d8077b636b7efb5cd3a
diff --git a/dev/js/src/match/table.js b/dev/js/src/match/table.js
index 1544637..61c100a 100644
--- a/dev/js/src/match/table.js
+++ b/dev/js/src/match/table.js
@@ -244,13 +244,19 @@
// Add tokens
for (var i in this._token) {
- var c = tr.addCell('th', undefined, this.getToken(i));
+ let surface = this.getToken(i);
+ var c = tr.addCell('th', undefined, surface);
if (this._mark[i]) {
c.classList.add('mark');
if (this._markE === undefined) {
this._markE = c;
};
};
+
+ // In case the title is very long - add a title attribute
+ if (surface.length > 20) {
+ c.setAttribute("title", surface)
+ }
};
var tbody = table.addE('tbody');