I have an HTML template where i need to display XML with tags inside th of a table. I tried the table-layout:fixed;word-wrap:break-word;width:100%
for table tag, but it was dividing the table equally and text in th were not coming to new line as shown in below image.
sample.html
<html>
<body>
<style>
.queryTable {
table-layout:fixed;
width:100%;
word-wrap:break-word;
}
th, .markHead{
background-color:#124191;
color:white;
}
</style>
<h2>Sample Table </h2>
<table border="1" class="queryTable">
<thead>
<tr>
<th class="six wide">Table Name</th>
<th class="six wide">Response Time (in sec.)</th></tr>
</thead>
<tbody>
<th class="markHead" style="text-align:left;"><xmp>......Some XML.......
</xmp></th>
<td>33.33</td>
<th class="markHead" style="text-align:left;"><xmp>......Some XML.......
</xmp></th>
<td>22.33</td>
<th class="markHead" style="text-align:left;"><xmp>......Some XML.......
</xmp></th>
<td>32.72</td>
<th class="markHead" style="text-align:left;"><xmp>......Some XML.......
</xmp></th>
<td>34.30</td>
</tr>
</tbody>
</table>
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire