Cell styling in datatable

Hi,
99% of my script is webix based and there is this 1% that I would like to include but I do not know how or if it is possible at all. There is a requirement from higher level of management to use some specific forms when requesting invoicing in SAP. So basically, we prepare everything (input data, reports, uploads etc) in webix environment but when it comes to this form, I just have to use pure HTML to make it look like official document.

What I am asking now: is it possible to use webix datatable or some other view which can be exported to PDF or excel and keep format that I have uploaded here: http://s17.postimg.org/8zn44iv7z/Capture.jpg

The logic is quite simple: there are 16 columns with different widths and some of them are joined with colspan, some of them use background color, some of them have borders, but when it comes to cross browser rendering then it is pure pain. What I imagine is that I should use webix styling and determine class for each possibility and then in the data part include style. The tricky part is to apply style for specific cell. I can do it for column or row, but how to apply it to the cell.

If there are some suggestions I would be thankful.

(a) export to pdf doesn’t include colors for now, so if you need to have a color-coded table in export - html table is probably the better solution.

(b) you can create table with colspans and rowspans in both header and data parts. As for cell level styling

http://docs.webix.com/datatable__styling.html#cells

It possible to use $cell property in the data to define css classes for cells directly ( also you can use addCellCss method to set classes dynamically )

As for provided image - I don’t see a problem to style webix datatable to look the same.

Hi Maksim and thanks for your answer:

a) yeah, export uses default colors and it seems that html is better solution for now.

b) I tried to make prototype table and it is not that hard. The only issue that I can not solve is to apply css to merged columns (colspan). http://webix.com/snippet/cb69e683

As I can see, it should not be that hard to generate webix solution and I really hope that we will be able to export colors :slight_smile:

When you are creating span, the last parameter - name of css class for that span

http://webix.com/snippet/051b13f6