I want the table with borders to show inside the list view.I used html table inside list view,but I cant get the border lines(rows and columns)(tried border=”2″).I tried to get the border using css also,but I cant get the table lines.
code:
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
<LayoutTemplate>
<table id="Table1" border="2" runat="server" class="TableCSS">
<tr id="Tr1" runat="server" class="TableHeader">
<td id="Td1" runat="server">OwnedBy </td>
<td id="Td2" runat="server">Sharedclass </td>
<td id="Td3" runat="server">EffectiveInterest </td>
<td id="Td4" runat="server">DeemedInterest </td>
</tr>
<tr id="ItemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<asp:listview>
css:
.TableCSS
{
border-bottom-width:thin;
border-left-width:thin;
border-bottom-color:Black;
background-color:Red;
width:auto;
}
.TableHeader
{
border:12px;
background-color:black;
color:Snow;
font-size:11px;
font-family:Verdana;
height:auto;
text-align:center;
}
To see the table lines, set background for the table and give cellspacing=”1″(Add cellspacing attribute to your Table tag) and apply the background color for all TD tags inside table.