Hello,
I have a table of records of this type where i stored a collection:
TYPE TABLE_RECORD IS RECORD (n_lin number, n_col number, val varchar(4000)); TYPE TABLE_CHUNK IS TABLE OF TABLE_RECORD;
Let imagine i have this records inside:
-- 1 0 DATA
-- 1 1 UGW
-- 1 2 500
-- 2 0 DATA
-- 2 1 Teste
-- 2 2 100
The first is the line number,the second is the column number and the third the value.
I want to loop all the collection and build the table body in html, but the number of columns in the head can be variable so i never know how many static <td> i will have . For the head i loop a table that contain all the clauses for the select statement so its more easy.
l_columns_data DYNAMIC_TABLE.TABLE_CHUNK :=DYNAMIC_TABLE.TABLE_CHUNK();
htp.p(' <tbody>');
FOR j IN 1..l_columns_data.COUNT LOOP
htp.p( ' <tr>');
htp.p('<td> '||l_columns_data(j).val||'</td>');
htp.p('</tr>');
end loop;
htp.p( '</tbody>
</table>
');
The objective is that ever 3 rows from the collection that has the line number "1" create a row in the table <tr> and then accordingly with the number of columns create a correspondent <td> with the associated value.
You know how can i achieve this?
Thanks.
APEX Version: 20
Database Version: 18C