Ajout d'un exemple basique dans la démo

This commit is contained in:
Vincent Calame 2022-08-09 00:54:00 +02:00
parent 272992b10e
commit 2ff64863ee

View File

@ -8,10 +8,10 @@
<script type="text/javascript" src="../build/html2ods.js"></script>
<script>
function fodsLink() {
let link = document.getElementById("link");
function fodsLink(linkdId, tableId) {
let link = document.getElementById(linkdId);
link.href = URL.createObjectURL(
Html2Ods.blob("table", {
Html2Ods.blob(tableId, {
currency: "EUR",
datePattern: "DD/MM/YYYY"
})
@ -24,11 +24,18 @@ function fodsLink() {
</script>
</head>
<body>
<h1>Exemple dutilisation de jsHtml2Ods</h1>
<p>Basée sur la compilation dans le répertoire build/</p>
<div>
<p><a href="blob:" download="table.fods" id="link" onclick="fodsLink()">Version ODS</a></p>
<table id="table"
<h1>Exemples dutilisation de jsHtml2Ods</h1>
<h2>Table réduite à sa plus simple expression</h2>
<p><a href="blob:" download="table.fods" id="link1" onclick="fodsLink('link1', 'table1')">Version ODS</a></p>
<table id="table1">
<tr><td>Cellule 1.1</td><td>Cellule 1.2</td><td>Cellule 1.3</td></tr>
<tr><td colspan="2">Cellule 2.1 + 2.2</td><td>Cellule 2.3</td></tr>
</table>
<h2>Table plus complexe</h2>
<p><a href="blob:" download="table.fods" id="link2" onclick="fodsLink('link2', 'table2')">Version ODS</a></p>
<table id="table2"
data-od-sheetname="Tableau des projets"
data-od-fixed-rows="2"
data-od-fixed-columns="1">
@ -135,6 +142,5 @@ function fodsLink() {
</tr>
</tbody>
</table>
</div>
</body>
</html>