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

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

问题描述

HTML5 不支持高度"和宽度".如何在符合 HTML5 标准的同时设置 td 的宽度和高度?

<头><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>219班网</title><body bgcolor="silver"><div align="center"><表格><tr><td width="1000" height="250"><object width="100%" height="100%" data="frameTop.html"></object></td></tr><表格><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>

解决方案

的宽度属性在 HTML 5 中已弃用.

使用 CSS.例如

 

详细,像这样:

<tr><th>月</th><th>节省</th></tr><tr><td style="width:70%">一月</td><td style="width:30%">$100</td></tr><tr><td>二月</td><td>$80</td></tr>

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>

解决方案

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

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天全站免登陆