In my asp.net website i need to print the information that are inside a label. The information inside the label would be derived from the database. The label would consist of data such as the customer name, address, telephone number etc.I need this to be printed on a sheet of paper.On my webpage i have a button and a HTML table. The HTML table consist of the the customers information. Everything works fine for me. I can get the print. But i would like to get the data on the print page formatted. Ex. center aligned, with some fonts and font sizes. Im not able to do so.The following is my print preview page
and this my print page
Its good. But i would like to get the print page a little more stylish with any logos. The size of the text needs to be increased, the table should be rather centered. It would be good if i can get a border for the table in the print page. Basically i would like to do some styles in the print page.i tried implementing the printstyles css but im unable to get any results. The code im using during the button click event of the "Print" button is\[code\]protected void btnPrint_Click(object sender, EventArgs e){ StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); StringBuilder sb = new StringBuilder(); sb.Append("<script type = 'text/javascript'>"); sb.Append("window.onload = new function(){"); sb.Append("var divToPrint=document.getElementById('print');"); sb.Append("var printWin = window.open('', '', 'left=0"); sb.Append(",top=0,width=800,height=600,status=0');"); //sb.Append("printWin.document.write(<link rel='stylesheet' type='text/css' href='http://stackoverflow.com/questions/14051221/PrintStyle.css' media='print'/>\n);"); sb.Append("printWin.document.write(divToPrint.outerHTML);"); sb.Append("printWin.document.close();"); sb.Append("printWin.focus();"); sb.Append("printWin.print();}"); sb.Append("</script>"); ClientScript.RegisterStartupScript(this.GetType(), "GridPrint", sb.ToString());}\[/code\]It would be nice if someone can help me do this.