To keep exact formatting click Edit > Paste special > Paste special > LibreOffice 7.x Spreadsheet.
Another advantage is that you embed the spreadsheet into the document meaning that you can double-click the cells to edit the spreadsheet if you need to make a change.
In attached document the first table is Paste, the second is Paste Special
PasteSpecialSpreadsheet.odt (21.4 KB)
[Edit]
Or also Edit > Paste special > Paste special > HyperText Markup Language (HTML) for a Writer table