-7

此表打印不正确

<tr height="95%">
  <td width="100%">
    <div id="placeSchedule">
      <table bgcolor="red" width="100%" height="100%" border="1">
         <tr>
            <td>
              xyz
            </td>
         </tr>
      </table>
    </div>
  </td>
</tr>

> because of this <div> tag, my table
> under <dig> tag is not printing
> properly,, i am using AJAx here.. to
> overwrite things under <div> tag.. so
> please temme any alternative to <div>
> tag
4

1 回答 1

3

从该示例代码中,您缺少一个包装<table>标记。

尝试这个:

<table>
    <tr height="95%">
      <td width="100%">
        <div id="placeSchedule">
          <table bgcolor="red" width="100%" height="100%" border="1">
             <tr>
                <td>
                  xyz
                </td>
             </tr>
          </table>
        </div>
      </td>
    </tr>
 </table>

编辑:澄清我的评论:

表格的 100% 高度属性将把高度设置为父元素的 100% 。

您可以明确声明表格的高度,也可以通过 CSS 进行设置。如果你去掉百分比符号,那应该将表格的高度设置为静态 100 像素。

于 2009-05-08T18:22:53.577 回答