My code:
Declare
l_body CLOB;
l_body := '<html><head><style>tr:last-child {font-weight: bold;}</style></head><body>'
||'<table><tbody>'
|| '<tr>'
|| '<th style="font-weight:bold;border: 1px solid black; padding:6px;">Emp</th>'
|| '<th style="font-weight:bold;border: 1px solid black; padding:6px;">Days</th>'
|| '<th style="font-weight:bold;border: 1px solid black; padding:6px;">Amount</th>
</tr>';
for r in (select name, days, amount from employee)
loop
l_body := l_body || '<tr><td style="color:#000000;border: 1px solid black;">';
l_body_html := l_body_html || r.emp || '</td><td style="color:#000000;border: 1px solid black;">'
|| r.days|| '</td><td style="color:#000000;border: 1px solid black;">'
|| r.amount||'</td> </tr>';
end loop;
How to create the HTML table header and rows dynamically instead of the static columns and rows?
Based on the query, i should create the HTML table with the selected columns from the query and rows.