Set margins and properties of word document while export HTML Table in c# -


i'm french student in internship , i've word export html table.

i got table tablecontent = new table() , i'm using method export :

response.clear(); response.buffer = true; response.write(@"<!doctype html public ""-//w3c//dtd html 4.0           transitional//en"">"); response.addheader("content-disposition", "attachment;filename=datatable.doc"); response.contenttype = "application/msword"; string style = "<style>body {margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size:11px;}</style>"; stringwriter sw = new stringwriter(); htmltextwriter hw = new htmltextwriter(sw); tablecontent.rendercontrol(hw); response.charset = "iso-8859-1"; response.contentencoding = system.text.encoding.getencoding(1252); response.headerencoding = system.text.encoding.getencoding(1252); response.write(style); response.write(sw.tostring()); response.flush(); response.end(); 

but when read wordfile (.doc), selected view "web" in word, , when select "page" view, table not centered cause of huge left-margin.

i want know if can set word document a4 format , set margins center table.

it's set margins of tabel center

*     {         margin:0px;         padding:0px;          }         #all             {                  width:100%;                 margin:0px;                  } 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -