-2

I have the following QWeb PDF report code:

<div class="row black">
    <div t-field="o.name" class="label_code" style="padding: 1em; text-overflow: ellipsis;"/>
</div>

The o.name field is aligned to the left side of the container div. As label_code applies a background color to this div the result is that the text lacks space in the left.

How can I add an empty space character before o.name?

Here is an image of the issue:

The text inside the div -the black box- is aligned to the left side of the div

this is the result using code   before the div as mentioned by Pranjal in his answer:

<div class="row black">
    &#160;<div t-field="o.name" class="label_code" style="padding: 1em; text-overflow: ellipsis;"/>
</div>

Same printing adding the code   mentioned by Pranjal Gami

M.E.
  • 4,955
  • 4
  • 49
  • 128
  • What do you mean by that? Can you show a screenshot? I think what you want to achieve can be done with the `padding` – ChesuCR Feb 18 '18 at 22:58
  • @ChesuCR find attached screenshot, also note that padding has been used in the div. – M.E. Feb 19 '18 at 05:59

2 Answers2

1

Use the padding in the parent div

<div class="row black" style="padding-left: 15px;">
    <span t-field="o.name" class="label_code" style="padding: 1em; text-overflow: ellipsis;"/>
</div>
ChesuCR
  • 9,352
  • 5
  • 51
  • 114
0

Try to add this snippet before field tag.

&#160;
<div t-field="o.name" class="label_code" style="padding: 1em; text-overflow: ellipsis;"/>
Pranjal Gami
  • 214
  • 2
  • 15