Copy webpage tables to Excel without changing their formatting

Copying text from a webpage table using the clipboard is a common implementation. However, copying a table containing said text while keeping formatting intact in Excel isn’t addressed as often.
This blog gives an insight into the process with which a table can be copied to Excel while preserving the table’s format.