/ / Sterowanie stylem w pojedynczej komórce tabeli z kodu za - c #, asp.net

Elementy sterujące stylizacją w pojedynczej komórce tabeli z kodu za - c #, asp.net

Mam dynamiczną tabelę, w której dodaję elementy sterujące. Kiedy otwieram tę stronę w przeglądarce Firefox, elementy sterujące są od siebie wzajemne oraz w przeglądarce Internet Explorer. są wyrównane w poziomie. Jak ustawić styl tych kontrolek na podstawie kodu z tyłu?

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);

Odpowiedzi:

2 dla odpowiedzi № 1

Spróbuj ustawić tabCell.Wrap = false. To powinno zrobić, czego potrzebujesz.