Formatting a table for Print Format

I want to show a table with the elements of a Child table for the Print Format of a custom Doctype.

I want a fixed table with 8 rows and 9 columns, so that only the cells containing data are filled in, leaving the cells without data blank.

I’ve been testing, but I can not give the table the format I want.

Hi @vazdan,

have you tried an HTML/Jinja insert like this

	<td>{{ doc.items[0].item_code or "" }}</td>
	<td>{{ doc.items[0].item_name or "" }}</td>
	<!-- ... -->
            {% if doc.items[1] %}
	<td>{{ doc.items[1].item_code or "" }}</td>
	<td>{{ doc.items[1].item_name or "" }}</td>
	<!-- ... -->
            {% else %}
            <!-- define empty row -->
            {% endif %}
  <!-- ... -->

Define your hard-coded table design, fill the content where available.

Hope this helps.


I tried similar things, but none like this. Thank you @lasalesi