Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
:- use_module(library(http/html_write)).
theader([]) --> []. theader([H|T]) --> html(th(H)), theader(T).
trows([],_) --> []. trows([R|T], N) --> html(tr([td(N),\trow(R)])), { N1 is N + 1 }, trows(T, N1).
trow([]) --> []. trow([E|T]) --> html(td(E)), trow(T).
table :-
Header = ['X','Y','Z'],
Rows = [
[7055,5334,5795],
[2895,3019,7747],
[140,7607,8144],
[7090,475,4140]
],
phrase(html(table([tr(\theader(Header)), \trows(Rows,1)])), Out, []),
print_html(Out).

View file

@ -0,0 +1,7 @@
<table>
<tr><th>X</th><th>Y</th><th>Z</th></tr>
<tr><td>1</td><td>7055</td><td>5334</td><td>5795</td></tr>
<tr><td>2</td><td>2895</td><td>3019</td><td>7747</td></tr>
<tr><td>3</td><td>140</td><td>7607</td><td>8144</td></tr>
<tr><td>4</td><td>7090</td><td>475</td><td>4140</td></tr>
</table>