asp.net页中的表格未正确显示 [英] table in asp.net page is not being displayed correctly

查看:98
本文介绍了asp.net页中的表格未正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个网页,其中包含一个可动态更改的表,该表所使用的代码如下所示:

I have developed a webpage which contain a dynamically changable table the code i used i shown below :

string dynTable = "";
            dynTable = "<table  ID=\"tablechange\" cellspacing=\"0\" cellpadding=\"2\" border-collapse: collapse\">";
            for (int TableRows = 0; TableRows < finalrow; TableRows++)
            {
                dynTable += "<tr>";
                for (int TableColumns = 0; TableColumns < 5; TableColumns++)
                {
                    if (x <= count) break;
                    dynTable += "<td style=\"color: Black; width: 100px; border-color: #000000; border-style: solid none solid solid;\">"; dynTable += Display[count, 0]; dynTable += "</td>";
                    dynTable += "<td style=\"color: Black; width: 35px; border-style: solid solid solid none; border-color: #000000;\" title=" + Display[count, 2] + " bgcolor=" + Display[count, 1] + ">"; dynTable += ""; dynTable += "</td>";
                    dynTable += "<td style=\"width: 2px\">"; dynTable += "</td>";
                    count++;
                }
                dynTable += "</tr>";
                dynTable += "<tr>";
                dynTable += "<td style=\"height: 2px;\"></td>";
                dynTable += "</tr>";
            }
            dynTable += "</table>";
            Literal1.Text = dynTable;




当我在Web开发人员中调试时,该表将按预期显示边框和所有总线,而当我在asp.net中托管该网页时,边框似乎丢失了,所以我放置了一个链接,以实现更好的可视化效果.我在iis中托管后调试并显示了secodn一个节目

http://img841.imageshack.us/i/unledjb.png/ [




when i debug in web developer the table is being displayed as intended with border and everything bus where as when i host the webpage in asp.net the border seem to be missing i have put a link for ur better visualisation top pic show the one when i debug and secodn one shows after i host it in iis

http://img841.imageshack.us/i/unledjb.png/[^]

They idea on what i wrong pls help =)

推荐答案

,因为您在边框折叠前缺少style ='':在表格标签处折叠.我认为这可能会解决.我在表格标签中添加了border ="1''style =" border-collapse:塌陷''.并显示边框.
for one thing you are missing style='' before border-collapse: collapse at the table tag. I think that might fix it. I put border=''1'' style=''border-collapse: collapse'' in the table tag. and the border shows up.


这篇关于asp.net页中的表格未正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆