|
1 | 1 | /*! |
2 | | - * TableExport.js v3.2.11 (https://www.travismclarke.com) |
| 2 | + * TableExport.js v3.2.12 (https://www.travismclarke.com) |
3 | 3 | * Copyright 2016 Travis Clarke |
4 | 4 | * Licensed under the MIT license |
5 | 5 | */ |
|
41 | 41 | ignoreRows = self.settings.ignoreRows instanceof Array ? self.settings.ignoreRows : [self.settings.ignoreRows], |
42 | 42 | ignoreCols = self.settings.ignoreCols instanceof Array ? self.settings.ignoreCols : [self.settings.ignoreCols], |
43 | 43 | ignoreCSS = self.settings.ignoreCSS instanceof Array ? self.settings.ignoreCSS.join(", ") : self.settings.ignoreCSS, |
| 44 | + emptyCSS = self.settings.emptyCSS instanceof Array ? self.settings.emptyCSS.join(", ") : self.settings.emptyCSS, |
44 | 45 | bootstrapClass, bootstrapTheme, bootstrapSpacing; |
45 | 46 |
|
46 | 47 | if (self.settings.bootstrap) { |
|
74 | 75 | if (!!~ignoreCols.indexOf(ic) || $(val).is(ignoreCSS)) { |
75 | 76 | return; |
76 | 77 | } |
| 78 | + if ($(val).is(emptyCSS)) { |
| 79 | + return " " |
| 80 | + } |
77 | 81 | if (val.hasAttribute('colspan')) { |
78 | 82 | rcMap[ir] = rcMap[ir] || {}; |
79 | 83 | rcMap[ir][ic+1] = val.getAttribute('colspan') - 1 |
|
112 | 116 | if (!!~ignoreCols.indexOf(ic) || $(val).is(ignoreCSS)) { |
113 | 117 | return; |
114 | 118 | } |
| 119 | + if ($(val).is(emptyCSS)) { |
| 120 | + return " " |
| 121 | + } |
115 | 122 | if (val.hasAttribute('colspan')) { |
116 | 123 | rcMap[ir] = rcMap[ir] || {}; |
117 | 124 | rcMap[ir][ic+1] = val.getAttribute('colspan') - 1 |
|
150 | 157 | if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) { |
151 | 158 | return; |
152 | 159 | } |
| 160 | + if ($(val).is(emptyCSS)) { |
| 161 | + return " " |
| 162 | + } |
153 | 163 | return $(val).text(); |
154 | 164 | }).get().join(colD); |
155 | 165 | }).get().join(rdel), |
|
175 | 185 | if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) { |
176 | 186 | return; |
177 | 187 | } |
| 188 | + if ($(val).is(emptyCSS)) { |
| 189 | + return " " |
| 190 | + } |
178 | 191 | return $(val).text(); |
179 | 192 | }).get().join(colD); |
180 | 193 | }).get().join(rdel), |
|
200 | 213 | if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) { |
201 | 214 | return; |
202 | 215 | } |
| 216 | + if ($(val).is(emptyCSS)) { |
| 217 | + return " " |
| 218 | + } |
203 | 219 | return $(val).text(); |
204 | 220 | }).get().join(colD); |
205 | 221 | }).get().join(rdel), |
|
264 | 280 | position: "bottom", // (top, bottom), position of the caption element relative to table, (default: "bottom") |
265 | 281 | ignoreRows: null, // (Number, Number[]), row indices to exclude from the exported file (default: null) |
266 | 282 | ignoreCols: null, // (Number, Number[]), column indices to exclude from the exported file (default: null) |
267 | | - ignoreCSS: ".tableexport-ignore" // (selector, selector[]), selector(s) to exclude from the exported file (default: ".tableexport-ignore") |
| 283 | + ignoreCSS: ".tableexport-ignore", // (selector, selector[]), selector(s) to exclude cells from the exported file (default: ".tableexport-ignore") |
| 284 | + emptyCSS: ".tableexport-empty" // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file (default: ".tableexport-empty") |
268 | 285 | }, |
269 | 286 | /** |
270 | 287 | * Character set (character encoding) of the HTML. |
|
0 commit comments