# Code indentation affecting the position of items in a table

**URL:** <https://community.silverfin.com/t/code-indentation-affecting-the-position-of-items-in-a-table/2186>\
**Category:** Reports\
**Tags:** tables, styling, indentation\
**Created:** [December 9, 2021, 9:12am UTC](https://community.silverfin.com/t/code-indentation-affecting-the-position-of-items-in-a-table/2186 "2021-12-09T09:12:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicoleP](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@NicoleP](https://community.silverfin.com/u/NicoleP)\
**Post date:** [December 9, 2021, 9:12am UTC](https://community.silverfin.com/t/code-indentation-affecting-the-position-of-items-in-a-table/2186/1 "2021-12-09T09:12:14Z")

</div>

Hi there

I have run into the following issue:

I have been trying to use proper indentation to make my code more readable, however doing so causes my table and the elements in my table to become misaligned.

I would like my code to look like the below example for an unreconciled indicator:

```auto
<td class="usr-align-right">
   {% if interest_expenses_accounts_value-total_expenses_amount != 0 %}
      {% unreconciled interest_expenses_accounts_value-total_expenses_amount as:indicator unreconciled_text:unreconciled_text%}
   {% endif %}
</td>

```

But if I save my code like this, the resulting table looks as follows with the unreconciled indicator being misaligned:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/6/6daa173ade55cfcfe70661a6c9f6e786539ae39c.png)

On the other hand, if I change my code to look like the below snippet, the unreconciled indicator is in line with the text like it should be:

```auto
<td class="usr-align-right">
   {% if interest_expenses_accounts_value-total_expenses_amount != 0 %}{% unreconciled interest_expenses_accounts_value-total_expenses_amount as:indicator unreconciled_text:unreconciled_text%}{% endif %}
</td>

```

Result:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/8/83b9285a6c30bfceb0608e178783b06c1e4b4304.png)

I have also noticed that the code indentation has an effect on the height of the rows:

Writing my code for each cell all in one line like below, results in the ideal row height, however my code is not very readable in this case.

```auto
<tr>
   <td>&nbsp;</td>
   <td><b>Total interest expense</b></td>
   <td>&nbsp;</td>
   <td class="usr-align-right">{% if interest_expenses_accounts_value-total_expenses_amount != 0 %}{% unreconciled interest_expenses_accounts_value-total_expenses_amount as:indicator unreconciled_text:unreconciled_text%}{% endif %}</td>
   <td>&nbsp;</td>
   <td class="usr-align-right"><b>{{ total_expenses_amount+interest_finance_leases | integer }}</b></td>
...
</tr>

```

Result:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/b/b1e1b18a73bb220fd30eb344c543d9c52299449a.png)

Is this perhaps something that will be fixed in the near future? Or would you recommend that I stick to writing my code in one line to keep the formatting correct?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [December 9, 2021, 10:05am UTC](https://community.silverfin.com/t/code-indentation-affecting-the-position-of-items-in-a-table/2186/2 "2021-12-09T10:05:03Z")

</div>

Hi @NicoleP ,

Thank you for sharing this.

We highly support that you are trying to structure your code this way to keep the code readable and maintainable. This is definitely a good practice 👍 .

However, in our HTML table functionality it’s currently not possible to add new lines in your code without creating a new line in your template. We have this on our list of improvements, but as a workaround you could try to add the `{% stripnewlines %}` tag around your table.

More information on the use of the tag can be found here: [Styling](https://developer.silverfin.com/docs/styling) and [CASE: make your code readable with stripnewlines and newline](https://community.silverfin.com/t/case-make-your-code-readable-with-stripnewlines-and-newline/366) (note that the `newline` tag is deprecated for HTML table purposes).

Hope this helps! If not, do not hesitate to reach out.

Kind regards,  
Robin

---

<div class="post-metadata">

**Author:** ![NicoleP](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@NicoleP](https://community.silverfin.com/u/NicoleP)\
**Post date:** [December 9, 2021, 10:18am UTC](https://community.silverfin.com/t/code-indentation-affecting-the-position-of-items-in-a-table/2186/3 "2021-12-09T10:18:03Z")

</div>

Hi Robin

Thank you very much! Adding the {% stripnewlines %} tag worked perfectly.
