简体   繁体   中英

Copy content of a page into excel by preserving the formatting

I have a page in angular js. There is a table like view on the page. This has been achieved using div tags and not a table tag. After copying this content into excel , its formatting changes. It does not get copied as it is.Any changes I can do in HTML file to copy it exactly how it is on the webpage?

In case you need a full copy of the table - you could create a separate "view" on the same page with a proper table markup (placed outside of viewport). And have a button to "copy table" with code attached that will put your table into clipboard.

Another guess is that you had to switch to divs because table markup didn't allow you something. In that case - look at handsontable library for google docs like tables. They have a community version and there is some bridge for angular as well. Maybe it'll do you some good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM