Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
GMAIL signature copy to clipboard

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

enter image description here

What do I need to do to prevent gmail from adding these unwanted css to my signature ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!