Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

What is wrong with this XHTML 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.

like image 553
yegor256 Avatar asked Mar 27 '11 08:03

yegor256


2 Answers

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

like image 106
andyb Avatar answered Nov 16 '22 00:11

andyb


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

like image 36
Lyubomyr Shaydariv Avatar answered Nov 16 '22 00:11

Lyubomyr Shaydariv