<table width="600" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td bgcolor="#580C0E">&nbsp;&nbsp;&nbsp;&nbsp;<span class="style4">联系内容</span></td>
    </tr>
  </table>
  <asp:DataGrid ID="Dg2" runat="server" GridLines="none" CellSpacing="0" AutoGenerateColumns="false" Width="600" HorizontalAlign="center" >
      <columns>
  <asp:TemplateColumn>
        <itemtemplate>
  <table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr align="center" valign="middle" bgcolor="#FFFFFF">
    <td width="83" height="24">联系时间:</td>
    <td width="231"><font color="#FF0000"><%# container.dataitem("time")%></font></td>
    <td width="83"><p>联系人:</p>    </td>
    <td width="227"><font color="#FF0000"><%# container.dataitem("name")%></font></td>
  </tr>
  <tr bgcolor="#D4D4D4">
    <td height="69" colspan="4"><font color="#FF0000">&nbsp;&nbsp;<%# container.dataitem("content")%></font></td>
  </tr>
</table>
</itemtemplate>
      </asp:TemplateColumn>
      </columns>
  </asp:DataGrid>
第一个table是单独的的第二个table是DataGrid的模板列,他们在页面上都没有镶套。都是都立的,怎么就在第一个table和DataGrid中间出现一道空格啊,一个单元格的距离,郁闷死我了,大家遇见过没有?

解决方案 »

  1.   

    <asp:DataGrid ID="Dg2" runat="server" GridLines="none" CellSpacing="0" AutoGenerateColumns="false" Width="600" HorizontalAlign="center" >
          <columns>
      <asp:TemplateColumn>
            <itemtemplate>
    这一段怎么会产生<tr>
    <td>&nbsp;</td>
    </tr>啊。一样得写法啊,怎么有得就没有啊,我晕死了啊。大家看看,帮俺找找啊
      

  2.   

    <asp:DataGrid ID="Dg2" runat="server" GridLines="none" CellSpacing="0" AutoGenerateColumns="false" Width="600" HorizontalAlign="center" >
          <columns>
      <asp:TemplateColumn>
            <itemtemplate>
    这一段怎么会产生<tr>
    <td>&nbsp;</td>
    </tr>