Générateur de tableau

Fermé
YuriBoyka13 Messages postés 43 Date d'inscription mardi 28 mai 2013 Statut Membre Dernière intervention 12 juillet 2013 - 12 juil. 2013 à 19:26
Bonjours je me suis fait un générateur de tableau puisqu'il est dynamique.. toutefois, ma rangé des radio boutons ne suit pas celle des noms.. Je ne comprends pas d'où vien le problème.. Merci d'avance, Yuri :D

CODE ASCX.CS
private void genererTableauAccord()
{
Table ta = new Table();
ta.Style.Add("margin-left", "25px");
ta.Style.Add("margin-top", "10px");
ta.BorderStyle = BorderStyle.None;
ta.CellSpacing = 0;
ta.CellPadding = 0;
int nbChoix = this.Volet.Choix_Reponses.Count;
//Ajout de la ligne du nom
TableRow trNom = new TableRow();
TableCell tdNom = new TableCell();

if (this.Volet.Nom.Contains(Constantes.CONST_ACCORD_ENTETE))
{
tdNom.Text = this.Volet.Nom.Substring(this.Volet.Nom.LastIndexOf(Constantes.CONST_ACCORD_ENTETE) + Constantes.CONST_ACCORD_ENTETE.Length);
}
else
{
tdNom.Text = this.Volet.Nom;
}
tdNom.ColumnSpan = nbChoix;
tdNom.CssClass = Constantes.CssClass.Accord_tdNom.ToString();
trNom.Cells.Add(tdNom);
ta.Rows.Add(trNom);
//Ajout de la légende
TableRow trLegende = new TableRow();
foreach (Choix_Reponse cr in this.Volet.Choix_Reponses)
{
TableCell tdLegende = new TableCell();
tdLegende.Text = cr.Legende;
tdLegende.CssClass = Constantes.CssClass.Accord_tdLegende.ToString();
trLegende.Cells.Add(tdLegende);
}
ta.Rows.Add(trLegende);
//Ajout du RadioButtonList
TableRow trRadio = new TableRow();
TableCell tdRadio = new TableCell();
tdRadio.ColumnSpan = nbChoix;
t = (TemplateRadioButtonList)LoadControl(Constantes.FILE_MEX);
t.Question = this.Question;
t.Volet = this.Volet;
t.RepeatColumns = 1;
t.RepeatDirection = RepeatDirection.Horizontal;
t.CssClass = Constantes.CssClass.RadioButtonListHorizontal.ToString();
tdRadio.Controls.Add(t);
trRadio.Cells.Add(tdRadio);
ta.Rows.Add(trRadio);
this.Controls.Add(ta);
}

CODE CSS
.Accord_tdNom
{
border-top: #507CD1 1px Solid;
border-left: #507CD1 1px Solid;
border-bottom: #507CD1 1px Solid;
border-right: #507CD1 1px Solid;
text-align: center;
background-color: #507CD1;
color: White;
font-weight: bold;
font-size: 14px;
padding: 5px;
}
.RadioButtonListHorizontal
{
text-align: center;
margin-left: 0px;
border-top: #507CD1 1px Solid;
border-left: #507CD1 1px Solid;
border-bottom: #507CD1 1px Solid;
border-right: #507CD1 1px Solid;
}
.RadioButtonListHorizontal td
{
width: 150px;
text-align: center;
vertical-align: middle;
font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
background-color: White;
color: #284E98;
padding: 5px;
}
.Accord_tdLegende
{
width: 150px;
text-align: center;
border-top: #507CD1 1px Solid;
border-left: #507CD1 1px Solid;
border-bottom: #507CD1 1px Solid;
border-right: #507CD1 1px Solid;
font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
background-color: White;
color: #284E98;
padding-top: 5px;
padding-bottom: 5px;
}

IMAGE DU BOGUE
http://www.hostingpics.net/viewer.php?id=932335testaccord.png

Si vous regardez bien, les radio boutons ne s'alligne pas en fonction de la largeur du nom de la colonne!!! J'attends des réponses svp :)