Closed domino-blake closed 4 years ago
Unfortunately, there is no functionality to do that currently. Did you expect an interface that can specify a class name to output table tags? or something else? Would you describe your expectations for more detail?
@domino-blake
You can output CSS with HtmlTablewriter
/CssTablewriter
of pytablewriter 0.51.0
or later.
I'm not so sure this is what you expected though.
Example:
from pytablewriter import HtmlTableWriter
writer = HtmlTableWriter()
writer.table_name = "write_css"
writer.headers = ["int"]
writer.value_matrix = [[1]]
writer.write_table(write_css=True)
Output:
<style type="text/css">
.write-css thead th:nth-child(1) {
text-align: left;
}
.write-css tbody tr:nth-child(1) td:nth-child(1) {
text-align: right;
}
</style>
<table class="write-css" id="write_css">
<caption>write_css</caption>
<thead>
<tr>
<th>int</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
Is it possible to add a custom stylesheet to html table? Looked through the docs but wasn't able to see any clear instructions