How to save HTML table as pure text with format retained

Sometimes you may want to save a web page as text if you don't want the style and images, you just want a pure text file, no HTML structure, no CSS styles, no need to use it in a browser but a simple text editor. But you can not ingore the table, tables sometimes are very useful, but copy and paste to text, it will make it unreadable, unlike the paragraph of text, table has rows and columns, copy paste between broswer and text editor won't work for table.

Here is a solution. Use Emacs and it has built-in text browser which render html table in text mode but keep the rows and columns and readability. Let's see an example:

The table in browser

Copy the url and open it with eww. Execute M-x eww and paste the url(Ctrl + Y). Here is how it looks like in eww

Now copy the text in eww buffer and paste to text buffer

This is good for read, if you want to edit it, you must first edit in HTML then repeat the process, the best solution will be to convert the HTML table to table.el format, I didn't find it yet. But it's doable, just find the piece of elisp code in eww implementation which execute the convert and modify it to add separators like '-' and '|' in appropriate places.

If the page can not be accessed by eww browser, you can open it with Chrome browser and use the inspect element feature to copy the HTML source code of the table and save it as a HTML file, then you can open the file with eww-open-file command.