diff --git a/apps/client/src/widgets/collections/table/TablePrintView.css b/apps/client/src/widgets/collections/table/TablePrintView.css new file mode 100644 index 000000000..09c6cae07 --- /dev/null +++ b/apps/client/src/widgets/collections/table/TablePrintView.css @@ -0,0 +1,7 @@ +.tabulator-print-table table, +.tabulator-print-table th, +.tabulator-print-table tr, +.tabulator-print-table td { + border: 1px solid black !important; + border-collapse: collapse; +} \ No newline at end of file diff --git a/apps/client/src/widgets/collections/table/TablePrintView.tsx b/apps/client/src/widgets/collections/table/TablePrintView.tsx index a7e36dfb3..cc73d7cd2 100644 --- a/apps/client/src/widgets/collections/table/TablePrintView.tsx +++ b/apps/client/src/widgets/collections/table/TablePrintView.tsx @@ -4,6 +4,7 @@ import useData, { TableConfig } from "./data"; import { ExportModule, PrintModule, Tabulator as VanillaTabulator} from 'tabulator-tables'; import Tabulator from "./tabulator"; import { RawHtmlBlock } from "../../react/RawHtml"; +import "./TablePrintView.css"; export default function TablePrintView({ note, noteIds, viewConfig }: ViewModeProps) { const tabulatorRef = useRef(null); @@ -21,16 +22,19 @@ export default function TablePrintView({ note, noteIds, viewConfig }: ViewModePr data={rowData} index="branchId" dataTree={hasChildren} - printAsHtml={true} printStyled={true} onReady={() => { const tabulator = tabulatorRef.current; if (!tabulator) return; - setHtml(tabulator.getHtml()); + const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print"); + if(tabulator.options.printFormatter){ + tabulator.options.printFormatter(tabulator.element, generatedTable); + } + setHtml(generatedTable.outerHTML); }} /> ) : ( - + )}