locked
DataList aligment RRS feed

  • Question

  • User-24013712 posted

    Hi and thanks in advance.

    I am using table in the DataList But i want to show table right to left. But it is not coming. Can you check this image so it clear.

    I used in datalist <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" height="100%" /> But it is totally in working. please can some one help. thank you.

    Friday, October 7, 2016 12:42 PM

All replies

  • User-2057865890 posted

    Hi Noorhaan,

    You could try handling it via CSS by using the "text-align" attribute :

    <asp:DataList ID="dataPublic" DataSourceID="sqlPublicSource" RepeatColumns="3" RepeatDirection="Vertical" runat="server" HorizontalAlign="center">
                <HeaderTemplate>
                    <table border="1" cellpadding="0" cellspacing="0" width="100%">
                        <tr height="400px" valign="top">
                </HeaderTemplate>
                <ItemTemplate>
                    <td style='width: 400px; text-align: left'>
                        <asp:HyperLink ID="imgPublic" ImageUrl='<%# "image/" + Eval("image") %>' NavigateUrl='<%# "image/" + Eval("image") %>' runat="server" />
                    </td>
                </ItemTemplate>
                <ItemTemplate>
                    <td style='width: 400px; text-align: center;'>
                        <asp:HyperLink ID="imgPublic" ImageUrl='<%# "image/" + Eval("image") %>' NavigateUrl='<%# "image/" + Eval("image") %>' runat="server" />
                    </td>
                </ItemTemplate>
                <ItemTemplate>
                    <td style='width: 400px; text-align: right;'>
                        <asp:HyperLink ID="HyperLink1" ImageUrl='<%# "image/" + Eval("image") %>' NavigateUrl='<%# "image/" + Eval("image") %>' runat="server" />
                    </td>
                </ItemTemplate>
                <FooterTemplate>
                    </tr>
                </table>
                </FooterTemplate>
            </asp:DataList>

    Best Regards,

    Chris

    Monday, October 10, 2016 5:48 AM