我有一个动态表,可以在其中添加控件。当我在 Firefox 中打开此页面时,控件彼此之间和 Internet expl. 它们水平对齐。如何从后面的代码中设置此控件的样式?
tabCell.HorizontalAlign = HorizontalAlign.Center; // doesn't seem to work
ibtnTableOneNew.Command += eventHandelerTableOne;
ibtnTableOneNew.Attributes.Add("runat", "server");
ibtnTableOneNew.CommandArgument = i.ToString() + "|" + theRow["siteAlias"].ToString();
ibtnTableOneNew.ImageUrl = "~/img/bullet_toggle_plus.png";
tabCell.Controls.Add(ibtnTableOneNew);
tabCell.Controls.Add(cbChecked);
ibtnTableOneNewComment.Attributes.Add("runat", "server");
ibtnTableOneNewComment.ImageUrl = "~/img/Pencil.png";
tabCell.Controls.Add(ibtnTableOneNewComment);
tabRow.Cells.Add(tabCell);