您好,我找到了一个解决方案,就是在打印的时候,我们这边重新绘制了table ,所以我的建议的是td上加上一个border,如下图
- function renderRow(panel, r) {
- var tr = '',
- row = panel.rows[r];
- if (row.renderSize > 0) {
- tr += '<tr>';
- for (var c = 0; c < panel.columns.length; c++) {
- var col = panel.columns[c];
- if (col.renderSize > 0) {
- // get cell style, content
- var style = 'width:' + col.renderSize + 'px;' +
- 'text-align:' + col.getAlignment() + ';' +
- 'padding-right: 6px; border:1px solid #000';
- var content = panel.getCellData(r, c, true);
- if (!row.isContentHtml && !col.isContentHtml) {
- content = wijmo.escapeHtml(content);
- }
- // add cell to row
- if (panel.cellType == wijmo.grid.CellType.ColumnHeader) {
- tr += '<th style="' + style + '">' + content + '</th>';
- } else {
- // show boolean values as checkboxes
- var raw = panel.getCellData(r, c, false);
- if (raw === true) {
- content = '☑';
- } else if (raw === false) {
- content = '☐';
- }
- tr += '<td style="' + style + '">' + content + '</td>';
- }
- }
- }
- tr += '</tr>';
- }
- return tr;
- }
- }
复制代码
|