다음 코드는 CSS를 사용하여 행 색상이 교대로 바뀌는 테이블을 HTML 파일에 작성합니다. 디스크에 기록한 후 예를 들어 html 파일을 직접 볼 때. 파이어 폭스, 크롬, IE 등, 교대 행 색상을 볼 수 있습니다. 그러나 VS2015에서 WebBrowser1 컨트롤로 html 파일을로드 한 후에는 행의 색상이 번갈아 가며 표시되지 않습니다.VS 2015 - WebBrowser 컨트롤이 CSS의 테이블 행 색상을 번갈아 나타내지 않음
다른 게시물을 확인한 결과 WebBrowser가 IE를 랩핑하고 WebBrowser의 문제를 극복하기 위해 타사 오픈 소스 설치와 관련된 해결 방법이 있습니다. 그러나 MS의이 문제에 대한 직접적인 해결책은 무엇입니까? 이것은 VS2015에 번들 된 현재 컨트롤이 CSS에 문제가 있음을 의미하기 때문에 MS 및 VS2015에 대한 미개발 문제처럼 보입니다. 이것에 대한 MS 기반 솔루션은 무엇입니까?
Dim sw As New StreamWriter(filename)
sw.WriteLine("<!DOCTYPE html><html><body>")
sw.WriteLine("<style type=" & """" & "text/css" & """" & ">")
sw.WriteLine("table.gridtable {")
sw.WriteLine(" font-family: verdana,arial,sans-serif;")
sw.WriteLine(" font-size:12px;")
sw.WriteLine(" color: #333333;")
sw.WriteLine(" border-width: 1px;")
sw.WriteLine(" border-color: #666666;")
sw.WriteLine(" border-collapse: collapse;")
sw.WriteLine("}")
sw.WriteLine("table.gridtable th {")
sw.WriteLine(" border-width: 1px;")
sw.WriteLine(" padding: 8px;")
sw.WriteLine(" border-style: solid;")
sw.WriteLine(" border-color: #666666;")
sw.WriteLine(" background-color: #dedede;")
sw.WriteLine("}")
sw.WriteLine("table.gridtable tr {")
sw.WriteLine("background-color: #ffffff;")
sw.WriteLine("}")
sw.WriteLine("table.gridtable tr:nth-child(even) {")
sw.WriteLine("background-color: #fdf5e6;")
sw.WriteLine("}")
sw.WriteLine("table.gridtable td {")
sw.WriteLine(" border-width: 1px;")
sw.WriteLine(" padding: 8px;")
sw.WriteLine(" border-style: solid;")
sw.WriteLine(" border-color: #666666;")
sw.WriteLine("}")
sw.WriteLine("</style>")
sw.WriteLine("<table class=" & """" & "gridtable" & """" & " Align=center>")
sw.WriteLine("<tr>")
sw.Write("<th>" & "Output" & "</th>")
sw.Write("<th>" & "Output" & "</th>")
sw.Write("<th>" & "Output" & "</th>")
sw.Write("<th>" & "Output" & "</th>")
sw.WriteLine("</tr>")
sw.WriteLine("<tr>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("</tr>")
sw.WriteLine("<tr>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("</tr>")
sw.WriteLine("<tr>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("</tr>")
sw.WriteLine("<tr>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("<td align=""center""><font color=" & """" & "#000000" & """" & ">Hello</font></td>")
sw.WriteLine("</tr>")
sw.WriteLine("</table>")
sw.WriteLine("</body></html>")
sw.dispose
이 페이지 체크 아웃 http://stackoverflow.com/questions/3822537/wpf-webbrowser-control-what-browser-does-it-use –
및 https://social.msdn.microsoft.com/Forums/ vstudio/ko-ko/6abee729-ac0b-47c5-9603-d1b3050618af/webbrowser-not-applying-css-correctly? forum = wpf –