I have a series of divs organized in a neat table format using display: table, table-row and table-cell rules. It looks great, but I've been asked to support users that want to copy the text and paste into excel. In the past, we've had similar reports that are rendered in plain html tables (tr, td etc) and I guess excel knows what to do with that to bring it in appropriately, but for the styled divs they just make one long column (which is not exactly ideal for a useful report).
Is it possible to do this without resorting to an html table?
My question is a simple "Is it possible?". I already have an alternative solution, I just don't want to have to go down that path if there is a better way.
The correct answer is Pressing the Esc key. It is a spreadsheet program for data analysis and documentation. It contains a number of rows and columns where the intersection of a column and a row is a "cell".
When you need to find and extract a column of data from one table and place it in another, use the VLOOKUP function. This function works in any version of Excel in Windows and Mac, and also in Google Sheets. It allows you to find data in one table using some identifier it has in common with another table.
There is not really a way around this - Excel doesn't take CSS layouts into account so will not interpret it correctly.
Besides, if people are copying this data into Excel, it suggests to me it is actual tabular data so a <table>
is probably the correct way to display it anyway - this is why the tag exists and is still valid in HTML5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With