HTML
Create raw HTML cells in WLJS Notebook and embed Wolfram Language expressions with WSP templates for custom rendered content.
Type .html in the first line of an input cell and start writing raw HTML on a new line:
.html
Here is my
<h3>Hello World</h3> Here is my
<h3>Hello World</h3> The input is also processed with PHP-like template engine (WSP) allowing to embed Wolfram expressions:
.html
<h3>Today is <?wsp Now // TextString ?></h3>
HTML cells are less strict regarding syntax variations than WLX because HTML tags aren’t parsed.
Generate a table from data
WSP templates can run nested Table expressions while emitting raw HTML. First evaluate data in an input cell:
data = Table[RandomWord[], {4}, {4}];Then use this HTML cell:
.html
<table class="table-auto">
<?wsp Table[ ?>
<tr class="bg-white border-b">
<?wsp Table[ ?>
<td class="px-3 py-2"><?wsp Item ?></td>
<?wsp , {Item, Row}] ?>
</tr>
<?wsp , {Row, data}] ?>
</table>For generated markup with XML-style tags instead, see the equivalent WLX table.