我不知道你的代码是怎么写的
我想应该不会有这种情况,以下是我写的 Table tbl = new Table();
TableRow row = new TableRow();
tbl.BorderWidth=1;
for (int i=0;i<10;i++)
{
row.Cells.Add(new TableCell());
row.Cells[i].Text ="?ń"+i;
}
tbl.Rows.Add(row);
this.PlaceHolder1.Controls.Add(tbl);
我想应该不会有这种情况,以下是我写的 Table tbl = new Table();
TableRow row = new TableRow();
tbl.BorderWidth=1;
for (int i=0;i<10;i++)
{
row.Cells.Add(new TableCell());
row.Cells[i].Text ="?ń"+i;
}
tbl.Rows.Add(row);
this.PlaceHolder1.Controls.Add(tbl);
解决方案 »
- XML节点读取问题
- 请问ACCESS有存储过程么,如何编写,如何调用?
- asp.net 怎样在服务器端打开新窗口
- ReportViewer打印按钮显示问题
- Connection 共享
- treeview控件动态加载节点
- 初学者的问题高分相送
- 列表框被动态增加一个项后,为什么默认全部选中?有没有简单办法取消其全选,循环不算。
- 分别按年,季度,月,日期范围一个统计图,思归等高手请进!
- 一个下拉列表框,我希望在他获得焦点的时候自动展开要怎么做?就是document.all.ddlb_1.focus() 的时候
- 在vs.net中设置编辑html时,为属性值自动添加引号
- 如何在网页中打开Excel文档不出现提示
try
{
tb.Attributes.Remove("style");
tb.Atrributes.Add("style","border-style:None;width:940px;word-break:break-all; word-wrap: break-word;");
}
catch(Exception ex)
{
throw(ex);
}
Dim td2 As New TableCell()
Table2.CellPadding = 0
Table2.CellSpacing = 0 tr1.BackColor = Color.LightGray td1.HorizontalAlign = HorizontalAlign.Center
td2.HorizontalAlign = HorizontalAlign.Center
td1.VerticalAlign = VerticalAlign.Middle
td1.BorderColor = Color.Black
td2.BorderColor = Color.Black td1.BorderWidth = Unit.Pixel(1)
td2.BorderWidth = Unit.Pixel(1) Dim txtXx As New TextBox()
txtXx.Width = Unit.Pixel(50)
txtXx.ID = "xx" + i.ToString()
td1.Text = "option" + i.ToString()
td2.Controls.Add(txtXx) tr1.Cells.Add(td1)
tr1.Cells.Add(td2) Table2.Rows.Add(tr1) End Function
Function addrow2(ByVal i)
Dim txtXx As New TextBox()
txtXx.Width = Unit.Pixel(10)
txtXx.ID = "xx" + i.ToString()
Page.Controls.Add(txtXx)
End Function
Function add3(ByVal tr As TableRow)
Dim txtXx As New TextBox()
txtXx.Width = Unit.Pixel(100)
txtXx.ID = "xx" + i.ToString()
txtXx.Text = "option" + i.ToString() Dim td As New TableCell()
td.Controls.Add(txtXx)
tr.Cells.Add(td)
Table2.Rows.Add(tr)
End Function
td1.BorderWidth = Unit.Pixel(1)输出的语句是这样的:<table id="tbShip" cellspacing="0" border="0" style="border-width:1px;border-style:solid;width:960px;border-collapse:collapse;">效果反映在style="border-width:1px;"这里但是还是有border="0"这样的代码输出,怎么回事哪?
cellSpacing 设置成0的时候,就会自动输出border-collapse:collapse
Table1.BorderWidth = Unit.Pixel(1);