I have app by which user can copy email signatures to clipboard and paste it to gmail signature in react js
Here is minimal code
import React, { useRef } from "react";
export default function App() {
const tableRef = useRef(null);
const CopyHtmlTableToCripboard = () => {
let tableRange = document.createRange();
tableRange.selectNodeContents(tableRef.current);
let sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(tableRange);
document.execCommand("Copy");
sel.removeAllRanges();
};
return (
<div className="App">
<div ref={tableRef} className="table">
<table
width="500"
cellPadding="0"
cellSpacing="0"
border="0"
className="apply-font"
>
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr
style={{
fontSize: "8px",
fontFamily: "Verdana",
color: "#fff",
lineHeight: "10px",
paddingTop: "10px",
backgroundColor: "red"
}}
>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
</tbody>
</table>
</div>
<button onClick={CopyHtmlTableToCripboard}>
Copy to Clipboard using execCommand
</button>
</div>
); }
Problem : When I copy the table to clipborad and paste it to gmail signature it adds unwanted css
What do I need to do to prevent gmail from adding these unwanted css to my signature ?