Reputation: 4202
So this is not so much a problem solving question, more a question of why this is happening.
For context, assume you have normal html table like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Check This Out</title>
</head>
<body>
<table border="1">
<tr>
<td width="75" >This</td>
<td width="75" >is</td>
<td width="75" >row</td>
<td width="75" >one</td>
<td width="75" ><a href="">Details</a></td>
</tr>
<tr>
<td>Now</td>
<td>this</td>
<td>is</td>
<td>TWO</td>
<td><a href="">Details</a></td>
</tr>
<tr>
<td>Last</td>
<td>we</td>
<td>have</td>
<td>Three</td>
<td><a href="">Details</a></td>
</tr>
</table>
</body>
</html>
Using Edge or Chrome, when performing a select operation on of all the data on this table you can do it two different ways (let's ignore reverse-selecting for now):
If you select the data the first way, then copy/paste into Excel, you get all your data in nice rows and columns.
If you select the data the second way, then copy/paste into Excel, all your data shows up as plain text in the one cell you selected for your paste.
Why does this happen?
Upvotes: 2
Views: 1798
Reputation: 2350
This is related to your operation, and the operation description you mentioned is not very detailed. For example, these two points:
If the Start selecting position is outside the table, the content copied and pasted into Excel will be in the correct table format. But if it is in the table, the problem you mentioned may appear, and the second point mentioned needs to be considered.
If the End selecting position is in the table, the content copied and pasted into Excel will also be in the correct table format. But if it is outside the table, the problem you mentioned will occur.
I think this is because the different selection positions will result in whether the table structure is also copied. You can even copy the code directly into Excel, and it will display the correct format.
Upvotes: 2