2011-07-27 20 views
9

ラジオボタンリストのレイアウトがうまくいかない。出力を下の画像のようにしたい。ここでラジオボタンリストのレイアウトASP .Net

は私が達成しようとしているものをへのリンクです:ここでは

http://skitch.com/hiraldesai/fcfn9/radio-button-layout

は、上記目的を達成しようとしている私のコードですが、私はプログラムでラジオボタンの上のテキストを取得することはできませんよ。それはCSSのものですか?私は

AnswerRadioButtons.RepeatLayout = RepeatLayout.Table 
AnswerRadioButtons.RepeatDirection = RepeatDirection.Horizontal        

おかげ助言のためなどRepeatLayout、RepeatDirection、RepeatColumns、TextAlign、多くの異なる組み合わせを試してみました。

答えて

13

私はこのテストでそれを行うことができました。このCSS

.RBL label 
{ 
    display: block; 
} 

.RBL td 
{ 
    text-align: center; 
    width: 20px; 
} 
+0

と垂直アラインで

<asp:RadioButtonList ID="rbl" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table" CssClass="RBL" TextAlign="Left"> <asp:ListItem Text="radio button 1" /> <asp:ListItem Text="radio button 1" /> <asp:ListItem Text="radio button 1" /> </asp:RadioButtonList> 

:ボトム。 .RBL tdスタイル用 –