# Escape slashes in a formula

**URL:** <https://air.tableforums.com/t/escape-slashes-in-a-formula/602>\
**Category:** Fields and Formulas\
**Created:** [May 18, 2023, 10:14am UTC](https://air.tableforums.com/t/escape-slashes-in-a-formula/602 "2023-05-18T10:14:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/ricardo/32/169_2.png) [@Ricardo](https://air.tableforums.com/u/Ricardo)\
**Post date:** [May 18, 2023, 10:14am UTC](https://air.tableforums.com/t/escape-slashes-in-a-formula/602/1 "2023-05-18T10:14:10Z")

</div>

Hi, I’m trying to use a formula field to combine the rollup of HTML table rows with a table header. I have added slackes in front of the quotation marks to escape them and wonder how to treat the slashes that close the HTML tags?

```auto
<p><table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">
<tbody>
<tr>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Date</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Nights</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Host</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Location</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Phone</strong></td>
</tr>

```

---

<div class="post-metadata">

**Author:** ![ScottWorld](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/scottworld/32/5_2.png) [@ScottWorld](https://air.tableforums.com/u/ScottWorld)\
**Post date:** [May 18, 2023, 2:14pm UTC](https://air.tableforums.com/t/escape-slashes-in-a-formula/602/2 "2023-05-18T14:14:47Z")

</div>

Those are forward slashes, so you shouldn’t need to escape those.

---

<div class="post-metadata">

**Author:** ![bfrench](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/bfrench/32/46_2.png) [@bfrench](https://air.tableforums.com/u/bfrench)\
**Post date:** [May 20, 2023, 11:52pm UTC](https://air.tableforums.com/t/escape-slashes-in-a-formula/602/3 "2023-05-20T23:52:23Z")

</div>

> [@Ricardo](#):
>
> I have added slackes in front of the quotation marks to escape them

It’s possible that escaping only the double quote could get you into trouble. What if the HTML contained single quotes?

---

<div class="post-metadata">

**Author:** ![Kuovonne](https://yyz1.discourse-cdn.com/flex029/user_avatar/air.tableforums.com/kuovonne/32/17_2.png) [@Kuovonne](https://air.tableforums.com/u/Kuovonne)\
**Post date:** [May 21, 2023, 1:37am UTC](https://air.tableforums.com/t/escape-slashes-in-a-formula/602/4 "2023-05-21T01:37:34Z")

</div>

> [@Ricardo](#):
>
> I have added slackes in front of the quotation marks to escape them and wonder how to treat the slashes that close the HTML tags?

Are you showing the formula or the result of the formula?  
What you display doesn’t quite look like either one.

In general, slashes and quotes are both escaped with a preceding slash: `\\` for a slash, and `\"` for a quote.
