# Creating q code block with syntax highlighting in a message

**URL:** <https://forum.kx.com/t/creating-q-code-block-with-syntax-highlighting-in-a-message/12252>\
**Category:** Community Support\
**Tags:** blogs\
**Created:** [November 8, 2021, 2:55pm UTC](https://forum.kx.com/t/creating-q-code-block-with-syntax-highlighting-in-a-message/12252 "2021-11-08T14:55:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocuinneagain1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rocuinneagain1](https://forum.kx.com/u/rocuinneagain1)\
**Post date:** [November 8, 2021, 2:55pm UTC](https://forum.kx.com/t/creating-q-code-block-with-syntax-highlighting-in-a-message/12252/1 "2021-11-08T14:55:00Z")

</div>

1. Choose the “…” option to “Expand Toolbar”

1. Choose “\</\>” option to “Insert/Edit code sample”

1. a) Choose “q (kdb+ database)” in the “Language” dropdown

2. b) Enter the code you wish to display

3. c) Hit “Ok”

Your message will now contain a code block

&nbsp;

q)tab:( a:1 2;b:4 5) q)tab a b — 1 4 2 5 q)select a from tab // A qsql query a - 1 2

&nbsp;

**Tip:** To edit your code block double click on it

---

<div class="post-metadata">

**Author:** ![davidcrossey1](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@davidcrossey1](https://forum.kx.com/u/davidcrossey1)\
**Post date:** [November 8, 2021, 10:28pm UTC](https://forum.kx.com/t/creating-q-code-block-with-syntax-highlighting-in-a-message/12252/2 "2021-11-08T22:28:00Z")

</div>

Hi Rian,

Thanks for sharing an example of the code block within KX Community. I’ll mark this as solved.

Kind regards,

David

---

<div class="post-metadata">

**Author:** ![rocuinneagain1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rocuinneagain1](https://forum.kx.com/u/rocuinneagain1)\
**Post date:** [May 5, 2022, 1:03pm UTC](https://forum.kx.com/t/creating-q-code-block-with-syntax-highlighting-in-a-message/12252/3 "2022-05-05T13:03:00Z")

</div>

Instructions now also added for&nbsp;adding inline code to your questions & messages.
