HTML'td'的宽度和高度 [英] HTML 'td' width and height

查看:129
本文介绍了HTML'td'的宽度和高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML5不支持height和width。如何在符合HTML5标准的情况下设置td的宽度和高度?

The 'height' and 'width' are not supported in HTML5. How can I set a td's width and height while conforming to the HTML5 standard?

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>219 班網</title>
  </head>

  <body bgcolor="silver">
    <div align="center">
      <table>
        <tr>
          <td width="1000" height="250">
            <object width="100%" height="100%" data="frameTop.html"></object>
          </td>
        </tr>
      </table>
      <table>
        <tr>
          <td width="300" height="700" >
            <object width="100%" height="100%" data="frameLeft.html"></object>
          </td>
          <td width="700" height="700">
            <object width="100%" height="100%" data="frameRight.html"></object>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>


推荐答案

< width ; td> 在HTML 5中已弃用。

The width attribute of <td> is deprecated in HTML 5.

使用CSS。
例如

Use CSS. e.g.

 <td style="width:100px">

详细说明如下:

in detail, like this:

<table >
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td style="width:70%">January</td>
    <td style="width:30%">$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

这篇关于HTML'td'的宽度和高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆