开发者

Why text-align doesn't work in colgroup? [duplicate]

开发者 https://www.devze.com 2023-02-20 05:51 出处:网络
This question already has answers here: using text-align center in colgroup (4 answers) Closed 9 years ago.
This question already has answers here: using text-align center in colgroup (4 answers) Closed 9 years ago.

What is wrong with this 开发者_如何学GoXHTML 1.1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html><body><table>
  <colgroup>
    <col style="width: 10em; text-align: right;" />
    <col style="width: 10em;" />
  </colgroup>
  <tbody>
    <tr>
      <td>test1</td>
      <td>test2</td>
    </tr>
  </tbody>
</table></body></html>

The problem is that test1 is not aligned to right, as it is supposed to be.


Answered here already. Basically text-align doesn't apply to columns.


Perhaps, this would help you: http://www.w3.org/TR/CSS2/tables.html#columns

0

精彩评论

暂无评论...
验证码 换一张
取 消