Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
637 views
in Technique[技术] by (71.8m points)

object - HTML 'td' width and height

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...