Thứ Ba, 11 tháng 10, 2011

Table width in ie

table-layout takes two values:

1. auto: the table is layed out normally (see below). This is the default value.
2. fixed: the table obeys the width, even if it normally wouldn't.

Let's give the test table a width. This width is far too narrow to normally show all content, and therefore the table stretches up beyond the 100px. This is normal behaviour: widths on tables have always been more like a polite advice than a strict rule. If the table needs more space than the width allows, it takes more space.

< table style="width: 100px;" >

If we add table-layout: fixed, however, the table obeys the width, even if that results in unreadable content.

< table style="table-layout: fixed; width: 100px;" >

(http://www.quirksmode.org/css/tables.html#tablelayout)

Không có nhận xét nào:

Đăng nhận xét