Is html deprecated?

2019-02-07 20:21发布

i'm looking at the W3Schools demo of using the <COL> element to align columns:

<table width="100%" border="1">
  <col align="left" />
  <col align="left" />
  <col align="right" />
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>

And browser's rendering of it is not encouraging:

Chrome (10.0.648.127):
enter image description here

FireFox (3.6.8):
enter image description here

Internet Explorer 9 (standards mode):
enter image description here

Internet Explorer 8 (standards mode):
enter image description here

Internet Explorer 7 (standards mode):
enter image description here

Internet Explorer (quirks mode): enter image description here

It's interesting to note that <COL align> used to work in browsers, and the feature was taken away in ie8. (And Chrome, with position of being the arbiter of all things perfect, doesn't support it.)

This makes me wonder if <COL align> is something that's not supposed to work.

Has <COL align> been deprecated?


Update One

i understand that it hasn't been formally deprecated. But the fact that browsers used to support it, then stopped supporting it makes me believe that there is some historical story that i'm missing. i assume the intentional removal of col align support from IE, and the continued lack of support from other browsers, indicates something is going on.

Update Two

i was mistakenly assuming lack of support for all features of <COL> meant <COL> itself isn't supported. i mistakenly assumed that since the only attribute i was trying wasn't working: that the element wasn't working. This was my mistake; and in hindsight i should have asked if "COL align" is deprecated (which it is).

In my defense i assumed an example would have been shown what wasn't working "anymore".

See also

标签: html html5 col
7条回答
干净又极端
2楼-- · 2019-02-07 21:24

In the interest of making the markup semantically meaningful have you considered substituting your <col> tags with <colgroup>?

<col> is purely used for styling whereas <colgroup> can be used to group related columns (Perhaps this is why you intend to align two of them left?) You can then apply CSS to the various colgroups to style them accordingly.

查看更多
登录 后发表回答