Space Between Table Rows

Posted by AGoodDisplayName on Stack Overflow See other posts from Stack Overflow or by AGoodDisplayName
Published on 2010-05-19T16:07:42Z Indexed on 2010/05/19 16:10 UTC
Read the original article Hit count: 164

Filed under:
|
|

This should be a simple problem, but I am have a tough time getting the html to display the way I want it...

The problem is the space between my table rows...I don't want space between my rows. I just want my table to look like a spreadsheet with black borders. I am using a datalist and have a table in the datalist control's templates. I have been messing with this for a couple of hours now and I have tried a few different variations of CSS and table attributes. Can anyone tell me where I am going wrong? Below is my current mark up.

<style type="text/css">
.tdHeader
{
    border-color: Black;
    border-style: solid;
    border-width: 1px;
    font-family: Arial;
    font-size: 8pt;
    margin: 0;
    background-color: #DCDCDC;
    font-weight: bold;
}
.tdBorder
{
    border-color: Black;
    border-style: solid;
    border-width: 1px;
    font-family: Arial;
    font-size: 8pt;
    margin: 0;
    text-align: center;
}
.trNoSpace
{
    margin: 0;
    padding: 0;
}
</style>

<asp:DataList ID="DataList1" runat="server" DataKeyField="Oid" 
DataSourceID="xdsHUDEligibilityMember">
<HeaderTemplate>
    <table cellspacing="0" width="600">
        <tr class="trNoSpace">
            <td class="tdHeader" width="100">Household Member Number
            </td>
            <td class="tdHeader">Household Member Name
            </td>
            <td class="tdHeader">Age of Household Member
            </td>
        </tr>
</HeaderTemplate>
<ItemTemplate>
        <tr class="trNoSpace">
            <td class="tdBorder">
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("Oid") %>' />
            </td>
            <td class="tdBorder">  
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("FullName") %>' />
            </td>
            <td class="tdBorder">
                <asp:Label ID="AgeAtEffectiveDateLabel" runat="server" Text='<%# Eval("AgeAtEffectiveDate") %>' />
            </td>
        </tr>
</ItemTemplate>    
<FooterTemplate>
        <tr class="trNoSpace">
            <td class="tdBorder">
            </td>
            <td class="tdBorder">
            </td>
            <td class="tdBorder">
            </td>
        </tr>
    </table>
</FooterTemplate>

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about html