HTML:
<div style="text-align: center">
<table width="90%" bgcolor="white" class="tableBorder" cellpadding="0" cellspacing="0" align="center">
<tr>
<td style="text-align: center; width: 917px;" align="center">
<div style="text-align:center;">
<asp:Table ID="Table1" border="1" cellpadding="0" cellspacing="0" runat="server" Width="100%" >
<asp:TableHeaderRow><asp:TableHeaderCell ColumnSpan="15">基本信息</asp:TableHeaderCell></asp:TableHeaderRow>
<asp:TableRow>
<asp:TableCell Width="62">姓名:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="username" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">职工编号:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="usernum" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">出生日期:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="userbirthdate" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">
性别:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="usersex" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">民族:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="usernation" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">在册标识:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="user" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">介绍人:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="userintro" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell >
<asp:Label ID="probationtime" runat="server" Text="Label"></asp:Label>
问题:Table控件后面总是空出“20”像素的距离,无论设置最后这个单元格为多宽,哪怕设置为100,这样Table控件的总宽度超过917,可还是空出20像素的距离。
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</td>
</tr>
<tr><td> 导出为:<asp:DropDownList ID="DropDownList1" runat="server" CssClass="buttoncss">
<asp:ListItem Value="Word">Word文档</asp:ListItem>
<asp:ListItem Value="Excel">Excel文档</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="导出" CssClass="buttoncss" /></td></tr>
</table>
</div>
<div style="text-align: center">
<table width="90%" bgcolor="white" class="tableBorder" cellpadding="0" cellspacing="0" align="center">
<tr>
<td style="text-align: center; width: 917px;" align="center">
<div style="text-align:center;">
<asp:Table ID="Table1" border="1" cellpadding="0" cellspacing="0" runat="server" Width="100%" >
<asp:TableHeaderRow><asp:TableHeaderCell ColumnSpan="15">基本信息</asp:TableHeaderCell></asp:TableHeaderRow>
<asp:TableRow>
<asp:TableCell Width="62">姓名:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="username" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">职工编号:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="usernum" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">出生日期:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="userbirthdate" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">
性别:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="usersex" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">民族:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="usernation" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">在册标识:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="user" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62">介绍人:</asp:TableCell>
<asp:TableCell Width="62">
<asp:Label ID="userintro" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell >
<asp:Label ID="probationtime" runat="server" Text="Label"></asp:Label>
问题:Table控件后面总是空出“20”像素的距离,无论设置最后这个单元格为多宽,哪怕设置为100,这样Table控件的总宽度超过917,可还是空出20像素的距离。
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</td>
</tr>
<tr><td> 导出为:<asp:DropDownList ID="DropDownList1" runat="server" CssClass="buttoncss">
<asp:ListItem Value="Word">Word文档</asp:ListItem>
<asp:ListItem Value="Excel">Excel文档</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="导出" CssClass="buttoncss" /></td></tr>
</table>
</div>
<asp:Table ID="Table1" border="1" cellpadding="0" cellspacing="0" runat="server" Width="104%" >
<asp:TableHeaderRow runat="server"><asp:TableHeaderCell ColumnSpan="15" runat="server">基本信息</asp:TableHeaderCell></asp:TableHeaderRow>
<asp:TableRow runat="server">
<asp:TableCell Width="62px" runat="server">姓名:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="username" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62px" runat="server">职工编号:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="usernum" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62px" runat="server">出生日期:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="userbirthdate" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62px" runat="server">
性别:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="usersex" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62px" runat="server">民族:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="usernation" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62px" runat="server">在册标识:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="user" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell Width="62px" runat="server">介绍人:</asp:TableCell>
<asp:TableCell Width="62px" runat="server">
<asp:Label ID="userintro" runat="server" Text="Label"></asp:Label></asp:TableCell>
<asp:TableCell runat="server" >
<asp:Label ID="probationtime" runat="server" Text="Label"></asp:Label>
问题:Table控件后面总是空出“20”像素的距离,无论设置最后这个单元格为多宽,哪怕设置为100,这样Table控件的总宽度超过917,可还是空出20像素的距离。
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</td>
</tr>
<tr><td> 导出为:<asp:DropDownList ID="DropDownList1" runat="server" CssClass="buttoncss">
<asp:ListItem Value="Word">Word文档</asp:ListItem>
<asp:ListItem Value="Excel">Excel文档</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="导出" CssClass="buttoncss" /></td></tr>
</table>
</div>
改下table的宽度!