asp.net mvc - Align contents to right in MvcRazorToPdf library -
i have below view
generates pdf invoice using mvcrazortopdf
library
<table border="0"> <tr> <td> <h1>company name </h1> </td> <td> <div style="text-align:right;margin-right:0px;"> invoice </div> </td> </tr> </table> <hr/> <div> @model.invoicenum </div>
above code generates below view
in pdf
but how ever style above div
within td
invoice
, not able move invoice
text right side of pdf
. i've tried adding link bootstrap.css
doesn't work either. have solution this? has worked on styling pdf
mvcrazortopdf
librabry?
your text alignment being respected, default, table , cells collapsed fit content (easy check using browser tools inspect elements).
give table (or cells width), example
<table style="width:100%;">
however, using <table>
elements not practice (refer why not use tables layout in html? , why tables bad (for layout*) compared semantic html + css.). instead can use floats or relative/absolute positioning, example
<div style="position:relative;"> <h1>company name</h1> <span style="position:absolute;right:0;bottom:0">invoice</span> </div>
or
<div> <h1 style="display:inline-block">company name</h1> <div style="float:right;margin-top:40px;">invoice</div> </div>
Comments
Post a Comment