# Strike-through text

**URL:** <https://community.glideapps.com/t/strike-through-text/4939>\
**Category:** Ask for Help\
**Created:** [February 26, 2020, 8:05am UTC](https://community.glideapps.com/t/strike-through-text/4939 "2020-02-26T08:05:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![applemooz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/applemooz/32/1576_2.png) [@applemooz](https://community.glideapps.com/u/applemooz)\
**Post date:** [February 26, 2020, 8:05am UTC](https://community.glideapps.com/t/strike-through-text/4939/1 "2020-02-26T08:05:29Z")

</div>

How would one go with strike-through of text/numbers?  
I have formatted it in Google Sheet, but it is not reflected in Glideapp.

---

<div class="post-metadata">

**Author:** ![muazz1m](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/muazz1m/32/189_2.png) [@muazz1m](https://community.glideapps.com/u/muazz1m)\
**Post date:** [February 26, 2020, 9:03am UTC](https://community.glideapps.com/t/strike-through-text/4939/2 "2020-02-26T09:03:49Z")

</div>

To have formatted text, you can use Rich Text component.

```auto
Strikethrough uses two tildes. ~~Scratch this.~~

```

~~Scratch this.~~

Based on [https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)

---

<div class="post-metadata">

**Author:** ![applemooz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/applemooz/32/1576_2.png) [@applemooz](https://community.glideapps.com/u/applemooz)\
**Post date:** [February 26, 2020, 9:08am UTC](https://community.glideapps.com/t/strike-through-text/4939/3 "2020-02-26T09:08:59Z")

</div>

Yes, but my Google Sheet cell contains the strikethrough, and I want to show that in Glidapp.  
Not all cells in Google Sheet are strikethrough on that component, so I can’t use a general markup like you showed here.

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [February 26, 2020, 5:04pm UTC](https://community.glideapps.com/t/strike-through-text/4939/4 "2020-02-26T17:04:34Z")

</div>

Glide apps do not inherit this kind of formatting from your sheet.

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [February 26, 2020, 8:01pm UTC](https://community.glideapps.com/t/strike-through-text/4939/5 "2020-02-26T20:01:03Z")

</div>

I did a little hacking and came up with a function that may help you. It is a custom function so unfortunately won’t work with arrayformulas (at least I couldn’t get it to work with one). Also note Markdown does not support underline because of confusion with hyperlinks I’ve heard. One other **caveat** to keep in mind is that the markdown function will not fire, and change the resultant markdown text, unless the actual text in the feeder field is changed in some way.

I honestly don’t know how beneficial this would be in the long run but for me it was worth the mental exercise in creating it.

```auto
function Convert2Markdown(row, col) {
  var ss = SpreadsheetApp.getActiveSpreadsheet()
  var sheet = ss.getActiveSheet();
  var cell = sheet.getRange(row, col);
  var markdown = cell.getValue();
  
  if (cell.getTextStyle().isItalic()) {markdown = "*" + markdown+ "*";}
  if (cell.getTextStyle().isBold()) {markdown = " **" + markdown+ "**";}
  if (cell.getTextStyle().isStrikethrough()) {markdown = " ~~" + markdown+ "~~";}
  //if (cell.getTextStyle().isUnderline()) {markdown = "" + markdown+ "";} // note underline not supported in Markdown
  
  return markdown;  
}

```

Here is the result:

 ![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/35f13a8f82cb1312db7d3898a36425062ea395e1.png)  
 ![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/f/f11ee0dbb65a24d1f7c030c88c5afcceb9d72851.png)

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sam1/32/24823_2.png) [@sam1](https://community.glideapps.com/u/sam1)\
**Post date:** [May 6, 2021, 10:53am UTC](https://community.glideapps.com/t/strike-through-text/4939/6 "2021-05-06T10:53:53Z")

</div>

hi there  
there is 'original price" and discount price" column in my app .i want to show a on strike ‘original price’ of each product. is this possible?  
this was mentioned above ~~Scratch this.~~ but when i used it and entered the original price ,it is showing the same price for all products. 😕

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 6, 2021, 12:55pm UTC](https://community.glideapps.com/t/strike-through-text/4939/7 "2021-05-06T12:55:13Z")

</div>

I’m not sure I follow your problem. Did you type a number into a new rich text component instead of pointing it to a column in your data? If I’m understanding correctly, that would explain why all products have the same original price.

I think your best bet would be to use a rich text component, so you could apply the strike through markdown by using a template column and wrapping the price with the strikethrough markdown symbols.

An alternative would be to just type the value with the strikethrough on a word processor or different website and copy and paste that value into your data. Then it would work in any component and you wouldn’t need to wrap in is markdown.

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sam1/32/24823_2.png) [@sam1](https://community.glideapps.com/u/sam1)\
**Post date:** [May 6, 2021, 4:09pm UTC](https://community.glideapps.com/t/strike-through-text/4939/8 "2021-05-06T16:09:58Z")

</div>

i see,got it now thank you very much a lot for helping

---

<div class="post-metadata">

**Author:** ![JMD](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@JMD](https://community.glideapps.com/u/JMD)\
**Post date:** [September 16, 2022, 4:17am UTC](https://community.glideapps.com/t/strike-through-text/4939/9 "2022-09-16T04:17:40Z")

</div>

I can’t get to work.  
I have a list of names in my spreadsheet.  
I need to strikethrough on some.  
I’ve tried 2 tildes either side of text eg  
~~86. any name~~

and that is exactly how it appears in glide. It doesn’t show as strikethrough  
Thank you, Dance

---

<div class="post-metadata">

**Author:** ![JMD](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@JMD](https://community.glideapps.com/u/JMD)\
**Post date:** [September 16, 2022, 4:18am UTC](https://community.glideapps.com/t/strike-through-text/4939/10 "2022-09-16T04:18:32Z")

</div>

In the previous email I put the 2 tildes either side of 86. any name and when I hit reply I can see it did what it was supposed to do.  
But when I do the same in my spreadsheet, it simply puts the 2 tildes either side of the name in Glide.  
I’m using inline format for my list in glide.  
Thanks

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 16, 2022, 5:13am UTC](https://community.glideapps.com/t/strike-through-text/4939/11 "2022-09-16T05:13:42Z")

</div>

That will only work if you are displaying the value in a Rich Text component.

---

<div class="post-metadata">

**Author:** ![JMD](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@JMD](https://community.glideapps.com/u/JMD)\
**Post date:** [September 16, 2022, 7:23am UTC](https://community.glideapps.com/t/strike-through-text/4939/12 "2022-09-16T07:23:00Z")

</div>

Thanks Darren, I suspected as much. So no way to do it with my scenario ☹

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 16, 2022, 7:28am UTC](https://community.glideapps.com/t/strike-through-text/4939/13 "2022-09-16T07:28:16Z")

</div>

The only way would be with CSS, assuming your list is on a Details screen.  
If you’re using a List Layout, then no - not possible.

---

<div class="post-metadata">

**Author:** ![JMD](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@JMD](https://community.glideapps.com/u/JMD)\
**Post date:** [September 16, 2022, 7:44am UTC](https://community.glideapps.com/t/strike-through-text/4939/14 "2022-09-16T07:44:41Z")

</div>

It’s a list layout. I have these columns for my competition.  
Section number and name (grouped by this column)  
Competitor number and name  
Level  
It’s a large list (877 rows!)  
Can’t think of any other way to lay it out.  
JD

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 16, 2022, 11:34am UTC](https://community.glideapps.com/t/strike-through-text/4939/15 "2022-09-16T11:34:42Z")

</div>

> [@Cross out the price](https://community.glideapps.com/t/cross-out-the-price/38151/6):
>
> You could either use a template column to replace all of the numbers with the strikethrough version of the same number, or you could create a javascript code column that converts it like this: [image] return strikeThrough(p1.toString()); function strikeThrough(text) { return text .split('') .map(char =\> char + '\u0336') .join('') } The problem is that it loses the formatting from the number column, so you could use something like this version, which adds the ‘Rp’ and …

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:49pm UTC](https://community.glideapps.com/t/strike-through-text/4939/16 "2024-01-17T16:49:21Z")

</div>


