Center align using html2pdf with lines on both side
<table style="width: 100%;">
<tr>
<td style="text-align: center;width=100%;"><h4>Education</h4></td>
</tr>
</table>
This is the code I am using. Now i want o/开发者_如何学JAVAp like this:
How can I draw these horizontal lines?
If I paste http://fiddle.jshell.net/4QskF/show/light/ into the "enter a URL of your choice" box on the html2pdf homepage, I get output in the PDF which looks like your picture.
I used this HTML/CSS:
<div style="border-bottom: 1px solid #000"></div>
<h4 style="width:200px; margin:-10px auto 0 auto; text-align:center; background:#fff">Education</h4>
It might need some tweaks so you can actually use it in your document, but I think the idea works.
<table style="width: 100%; padding-top:-10px;">
<tr>
<td style="text-align: center;width=33%;"><hr style="height: .3mm; background: #000; "></td>
<td style="text-align: center;width=33%; padding-top:-5px;">
<h4>Education</h4>
</td>
<td style="text-align: center;width=33%;"><hr style="height: .3mm; background: #000; "> </td>
</tr>
</table>
This solved my problem.
精彩评论