开发者

How can we align the asp page in the following format

My page contains images and labels which are bound to a datalist. The label gets the text from a stored procedure. I need to align it in the following format.

IMAGE Label( The text starts right to the image and continues..

below the image when it is too lengthy..)

<asp:DataList ID="dlnews" runat="server" RepeatColumns="1" 
     开发者_StackOverflow中文版                                                       onitemcommand="dlnews_ItemCommand">
       <ItemTemplate>
          <table border="0" cellpadding="0" cellspacing="0" width="100%">
             <tr>
                <td colspan="2">
                  <asp:Label ID="lbltitle" runat="server" Text='<%#Eval("Title")%>'></asp:Label>
                </td>
             </tr>
             <tr>
                <td  style="width: 10%;"> 
                  <img id="imgn"  style="height: 70px; width: 70px" runat="server" src='xxx' />
                </td>
                <td>
                  <asp:Label ID="lCont" runat="server"  Text='<%# Eval("Description") %>'> 
                  </asp:Label>
                </td>
        </tr>
          </table>
        </ItemTemplate>
     </asp:DataList>


Something like this?

<style>
div.img
{float:left;}
div.txt
{width:50px;}
</style>

<div style='width:100px;height:1000px;'>
<div class='img'>
<img src='test'/>
</div>
<div>
Text Text Text Text 
</div>
<div class='img'>
<img src='test'/>
</div>
<div>
Text 
</div>
<div class='img'>
<img src='test'/>
</div>
<div>
Text Text Text Text Text Text Text Text 
</div>


look at the code below

<div>
<img src="sss" alt="aa" /><span style="word-wrap:break-word;"><asp:Label ID="lbl" runat="server" text="your text" /></span>

</div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜