Commit a57d90b2 authored by julien's avatar julien

change file structure

parent e395b7c0
......@@ -6,8 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>table work: colgroup</title>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
<style>
.flash {
background: pink;
......
......@@ -6,8 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>table work: longcell</title>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
</head>
......
......@@ -6,8 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>table work: longcell</title>
<!-- <script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script> -->
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
<style>
tr {
break-inside: avoid;
......
......@@ -6,8 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>table work: colgroup</title>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
<style>
tfoot {
background: pink;
......
......@@ -6,8 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>table work: colgroup</title>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
<style>
thead {
......
......@@ -6,8 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>table work: colgroup</title>
<!-- <script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script> -->
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
<style>
thead {
......
......@@ -3,8 +3,8 @@
<head>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<title>Does the Caption get repeated?</title>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
......
......@@ -3,37 +3,9 @@
<head>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<title>Does the Caption get repeated?</title>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<!-- fix footer -->
<!-- fix footer -->
<script>
class tfoot extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
}
beforeParsed(content) {
content.querySelectorAll('table').forEach(table => {
let tableFooter = table.querySelector('tfoot');
let tableHeader = table.querySelector('thead');
if (tableFooter) {
console.log(tableFooter);
table.insertAdjacentElement('beforeend', tableFooter)
}
if (tableHeader) {
console.log(tableHeader);
table.insertAdjacentElement('afterbegin', tableHeader)
}
})
}
}
Paged.registerHandlers(tfoot);
</script>
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
<script src="./js/moveTfootToTheEnd.js"></script>
</head>
......
......@@ -3,8 +3,8 @@
<head>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<title>Does the Caption get repeated?</title>
<link rel="stylesheet" href="css/interface.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="../assets/css/interface.css">
<link rel="stylesheet" href="../assets/css/table.css">
</head>
......
This diff is collapsed.
// a valid html has only one thead and one tfoot per table
// https://html.spec.whatwg.org/multipage/tables.html#the-table-element
class tfoot extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
}
beforeParsed(content) {
content.querySelectorAll('table').forEach(table => {
let tableFooter = table.querySelector('tfoot');
let tableHeader = table.querySelector('thead');
if (tableFooter) {
console.log(tableFooter);
table.insertAdjacentElement('beforeend', tableFooter)
}
if (tableHeader) {
console.log(tableHeader);
table.insertAdjacentElement('afterbegin', tableHeader)
}
})
}
}
Paged.registerHandlers(tfoot);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment