Dynamic Table in Dynamic Number of Table

Hi

The number of output table base on “h” and row base on “d” under each “h”. “T” is footer have only one low. And table can overflow to many page in each “H”.

I try to use js script, snippet to create table like table in image but still can’t.

I would like the output table as same as picture. DDo you have any idea to achieve this?. please advise and thank you.
Dynamic Table in Dynamic Number of Table.OL-datamapper (5.5 KB)

Hello @ruppawat ,

You best bet is to change how you extract your data. Simply change the second condition of your repeat by also including T. Also remove your third condition. Since multiple D and 1 T seems to be what you have in your data.

Dynamic Table in Dynamic Number of Table.OL-datamapper (5.3 KB)

You could use a standard dynamic table and reformat the rows and cells to mimic a multi table layout. Attached a sample template using your data mapping configuration illustrating this concept. The styling is in the content_all_styles.css file.

Erik

dynamic-table-2024-1.OL-template (9.2 KB)

<table style="width:100%" data-expander="2019" id="table">
	<tbody>
		<tr data-repeat="h">
			<td colspan="4" class="h2">(h) {{Name}}</td>
		</tr>
		<tr data-repeat="h" class="table-header table-row" data-show-row="all">
			<td style="width: 26.09%;">Detail</td>
			<td style="width: 26.66%;">Name</td>
			<td style="width: 23.88%;">Addr</td>
			<td style="width: 23.34%;">Post</td>
		</tr>
		<tr data-repeat="h.d" class="table-body table-row">
			<td>(d) {{Detail}}</td>
			<td>{{Name}}</td>
			<td>{{Addr}}</td>
			<td>{{Post}}</td>
		</tr>
		<tr data-repeat="h.t" class="table-end table-row">
			<td>(t) {{Detail}}</td>
			<td>{{Name}}</td>
			<td>{{Addr}}</td>
			<td>{{Post}}</td>
		</tr>
	</tbody>
</table>

Hello Jchamel and Erik
Thank you. For your advise.

@Erik may I ask you for my understanding. The number of “h” table came from this part “data-repeat=“h””?

I try to understand how to create new table when “h” record change.

It is not really creating new tables it is basically one long table. The styling makes it look like there are multiple tables.

Thank you so much. I clear.