bootstrap asp.net文本总是显示在新行上

时间:2017-10-20 06:35:51

标签: asp.net bootstrap-4

我在ASP.net webform上有一个listview。我想在每一行上有两列,事实是,第二列总是移动到一个新行。这是我的代码:

<form id="form1" runat="server">
<div>
    <asp:ListView ID="aa" runat="server">
    <ItemTemplate>
        <div class="container">
            <div class="row">
                <div class="col-lg-10">
                    Shows on first line/row
                </div>
                <div class="col-lg-2">
                    shows on a new line
                </div>
            </div>
        </div>
      </ItemTemplate>
    </asp:ListView>
</div>
</form>

1 个答案:

答案 0 :(得分:0)

你的意思是这样吗?

&#13;
&#13;
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<form id="form1" runat="server">
<div>
    <asp:ListView ID="aa" runat="server">
    <ItemTemplate>
        <div class="container">
            <div class="row">
             
                <div class="col-xs-6">
                first line 1 
                </div>
                <div class="col-xs-6">
                    second line 1
                </div>
            </div>
              <div class="row">
       
                <div class="col-xs-6">
                first line 2
                </div>
                <div class="col-xs-6">
                    second line 2
                </div>
            </div>
        </div>
      </ItemTemplate>
    </asp:ListView>
</div>
</form>
&#13;
&#13;
&#13;