Skip to content

Commit 4641370

Browse files
yulian-gaponenkoiText-CI
authored andcommitted
Add tests for thead, tbody and tfoot HTML elements
ITXT-CR-967
1 parent 46a5900 commit 4641370

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

src/test/java/com/itextpdf/html2pdf/element/TableTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,17 @@ public void thTagTest() throws IOException, InterruptedException {
291291
runTest("thTag", true);
292292
}
293293

294+
@Test
295+
@LogMessages(messages = @LogMessage(messageTemplate = LogMessageConstant.NOT_SUPPORTED_TH_SCOPE_TYPE, count = 2))
296+
public void theadTagTest() throws IOException, InterruptedException {
297+
runTest("theadTagTest", true);
298+
}
299+
300+
@Test
301+
public void tfootTagTest() throws IOException, InterruptedException {
302+
runTest("tfootTagTest", true);
303+
}
304+
294305
@Test
295306
public void brInTdTest() throws IOException, InterruptedException {
296307
runTest("brInTd");
Binary file not shown.
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<html>
2+
<head>
3+
<style>
4+
td, th {
5+
border: solid 1px;
6+
}
7+
table {
8+
border-collapse: collapse;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<table>
14+
<tbody>
15+
<tr>
16+
<td>Cell 1</td>
17+
<td>Cell 2</td>
18+
</tr>
19+
<tr>
20+
<td>Another cell 1</td>
21+
<td>Another cell 2</td>
22+
</tr>
23+
</tbody>
24+
<tfoot>
25+
<td>
26+
Footer 1
27+
</td>
28+
<td>
29+
Footer 2
30+
</td>
31+
</tfoot>
32+
</table>
33+
</body>
34+
</html>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<html>
2+
<head>
3+
<style>
4+
td, th {
5+
border: solid 1px;
6+
}
7+
table {
8+
border-collapse: collapse;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<table>
14+
<thead>
15+
<th>
16+
Header 1
17+
</th>
18+
<th>
19+
Header 2
20+
</th>
21+
</thead>
22+
<tbody>
23+
<tr>
24+
<td>Cell 1</td>
25+
<td>Cell 2</td>
26+
</tr>
27+
<tr>
28+
<td>Another cell 1</td>
29+
<td>Another cell 2</td>
30+
</tr>
31+
</tbody>
32+
</table>
33+
</body>
34+
</html>

0 commit comments

Comments
 (0)