简体   繁体   中英

How to shift row in the table?

I have this ASP code:

<asp:Repeater ID="PervousResultsList" runat="server" EnableViewState="False">
            <ItemTemplate>
                <div class="row1">
                    <table style="cursor: pointer; width: 100%">
                        <tr>  
                            <td>text:
                            </td>
                            <td><%# Eval("Text") %>
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="2">
                                <asp:Image ID="Image1" ImageUrl="~/Images/pushpinred.png" runat="server" Width="32"
                                    Height="32" />
                            </td>
                            <td>X:
                            </td>
                            <td>
                                <%# Eval("Lon") %>
                            </td>
                        </tr>
                        <tr>
                            <td>Y:
                            </td>
                            <td>
                                <%# Eval("Lat") %>
                            </td>
                        </tr>
                    </table>
                </div>
            </ItemTemplate>
        </asp:Repeater>

Here how it looks in the view:

在此处输入图片说明

My question is how can I shift text row that it will look like that:

在此处输入图片说明

Forget what I said before, this is probably what you are looking for:

<asp:Repeater ID="PervousResultsList" runat="server" EnableViewState="False">
        <ItemTemplate>
            <div class="row1">
                <table style="cursor: pointer; width: 100%">
                    <tr> 
                        <td colspan="2">text:
                        </td>
                        <td ><%# Eval("Text") %>
                        </td>
                    </tr>
                    <tr>
                        <td rowspan="2">
                            <asp:Image ID="Image1" ImageUrl="~/Images/pushpinred.png" runat="server" Width="32"
                                Height="32" />
                        </td>
                        <td>X:
                        </td>
                        <td>
                            <%# Eval("Lon") %>
                        </td>
                    </tr>
                    <tr>
                        <td>Y:
                        </td>
                        <td>
                            <%# Eval("Lat") %>
                        </td>
                    </tr>
                </table>
            </div>
        </ItemTemplate>
    </asp:Repeater>

Adding a colspan=2 attribute to your :text label/header field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM