For the first time I am working on using docx4j (version 2.8.1) to generate docx,PDF documents from XHTML, However I am facing some problems with css like the td of tr background color css is not getting applied. Please check below the html code which is rendered fine in browser
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.doc {
font-family: tahoma,verdana,arial,sans-serif;
font-size: 70%;
}
.myTable {
margin-bottom: 10px;
width: 100%;
border: 1px solid;
}
.myTable THEAD {
background: none repeat scroll 0 0 #EEEEEE;
}
.myTable TH {
padding: 7px 3px 2px;
}
.hrow TH {
background: none repeat scroll 0 0 #FFFFFF;
border-bottom: 1px solid #B3B3B3;
border-color: #B3B3B3;
border-width: 1px;
color: #003399;
font-size: 150%;
font-weight: normal;
padding-top: 10px;
text-align: left;
}
.myTable TD {
padding: 3px 5px 5px;
}
TABLE THEAD:first-child TH:first-child {
text-align: left;
}
TABLE THEAD:first-child .hrow TH {
padding-top: 0;
}
.evenRow TD {
background-color: #EFEFFF;
}
.rowEven TD {
background-color: #FEFEFF;
}
</style>
</head>
<body>
<div class="doc">
<table class="myTable">
<thead>
<tr class="hrow">
<th colspan="4">
First header row</th>
</tr>
</thead>
<thead>
<tr>
<th width="260px">first header</th>
<th xwidth="60px">second header</th>
<th xwidth="70px">third header</th>
<th width="260px">fourth header</th>
</tr>
</thead>
<tbody>
<tr class="evenRow">
<td width="260px">Row 1 col 1</td>
<td>Row 1 col 2</td>
<td>Row 1 col 3</td>
<td>Row 1 col 4</td>
</tr>
</tbody>
<tbody>
<tr class="oddRow">
<td width="260px">Row 2 col 1</td>
<td>Row 2 col 2</td>
<td>Row 2 col 3</td>
<td>Row 2 col 4</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
I was stuck up here, Can any one please provide your suggestions for moving further on these css issues
Thanks