Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir. i have a datalist in which i am two row. In first row i am showing subject name and in second row showing homework. And its look like:

English
  Learn chapter-1
Hindi
  Learn poem of chapter-10


now,i want to show a vartical line to connect all the subject and they look like:

English
 | Learn chapter-1
 | 
Hindi
  Learn poem of chapter-10


how can i do it. my datalist code is:


<asp:DataList ID="lvTweets" runat="server">
                        <ItemTemplate>
                            <table border="0" cellpadding="0" cellspacing="0" width="95%" align="center">
                                <tr>
                                    <td align="center">
                                        <table width="100%">
                                            <tr>
                                                <td style="height:25px">
                                                    <asp:Label ID="LblNewsID" runat="server" Visible="false" Font-Bold="false" Text='<%#Eval("HomeworkID") %>'></asp:Label>
                                                  <span class = "label label-info">  
                                                  <asp:Label ID="Label2" runat="server" Font-Bold="false" Text='<%#Eval("Subject") %>'></asp:Label>
                                                  </span>
                                                </td>
                                            </tr>
                                            </table>
                                            
                                            <table width="90%">
                                            <tr>
                                                <td>
                                                <p style="background-color:#E0AC2A; color:White"  class="rounded_corners"> <asp:Label ID="Label1" runat="server" Width="100%" Font-Bold="false" Text='<%#Eval("Homework") %>'></asp:Label></p> 
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <br />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:Label ID="Mensaje" runat="server" Visible="false" Text="Homework not updated">
                            </asp:Label>
                        </FooterTemplate>
                    </asp:DataList>


What I have tried:

i search on google but i did not get any solution of it. and i have no idea how can i do it.
Posted
Updated 20-Mar-17 21:25pm

1 solution

try

<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center">
                  <tr>
                      <td align="center">
                          <table width="100%">
                              <tr>
                                  <td colspan="2" style="height: 25px">
                                      <asp:Label ID="LblNewsID" runat="server" Visible="false" Font-Bold="false" Text='<%#Eval("HomeworkID") %>'></asp:Label>
                                      <asp:Label ID="Label2" runat="server" Font-Bold="false" Text='<%#Eval("Subject") %>'></asp:Label>

                                  </td>
                              </tr>
                              <tr>
                                  <td style="padding-left:20px; ">
                                      <div style="border-left:2px solid black;">
                                          <span style="padding-left:5px;">
                                      <asp:Label ID="Label1" runat="server" Width="100%"  Text='<%#Eval("Homework") %>'></asp:Label>
                                              </span>
                                          </div>
                                  </td>
                              </tr>
                          </table>


                      </td>
                  </tr>
              </table>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900