Can I get data in 'display: table'd divs in Excel correctly

I have a series of divs organized in a neat table format using the display: table, table-row and table-cell commands. It looks great, but I was asked to support users who want to copy text and paste into excel. We used to have similar reports that appear in simple html tables (tr, td, etc.), and I think excel knows what to do with it to bring it into line, but for stylized divs they just create one long column (which is not quite ideal for a useful report).

Is it possible to do this without resorting to the html table?

My question is simple: "Is it possible?". I already have an alternative solution, I just do not want to go this route if there is a better way.

+5
source share
1 answer

This is actually not the case - Excel does not take CSS layouts into account, so it will not interpret it correctly.

Also, if people copy this data into Excel, this tells me that this is the actual table data, so <table> is probably the right way to display it anyway - that’s why the tag exists and still works in HTML5.

+2
source

Source: https://habr.com/ru/post/1207220/


All Articles