>> English << | česky | PortuguêsZVON > Tutorials > CSS2 tutorial
>> Example 41 << | Prev | Next | Index | Contents

The CSS table model is based on the HTML 4.0 table model, in which the structure of a table closely parallels the visual layout of the table. (1) lays out a simple table, (2) draws borders as well.

XML SourceCSS stylesheetExample link
(1)
     <AAA>
          <BBB>
               <CCC>ccc1</CCC>
               <DDD>ddd1</DDD>
               <EEE>eee1</EEE>
          </BBB>
          <BBB>
               <CCC>ccc2</CCC>
               <DDD>ddd2</DDD>
               <EEE>eee2</EEE>
          </BBB>
          <BBB>
               <CCC>ccc3</CCC>
               <DDD>ddd3</DDD>
               <EEE>eee3</EEE>
          </BBB>
     </AAA>

AAA {display: table}
BBB {display: table-row}
CCC {display: table-cell}
DDD {display: table-cell}
EEE {display: table-cell}
View output
XML SourceCSS stylesheetExample link
(2)
     <AAA>
          <BBB>
               <CCC>ccc1</CCC>
               <DDD>ddd1</DDD>
               <EEE>eee1</EEE>
          </BBB>
          <BBB>
               <CCC>ccc2</CCC>
               <DDD>ddd2</DDD>
               <EEE>eee2</EEE>
          </BBB>
          <BBB>
               <CCC>ccc3</CCC>
               <DDD>ddd3</DDD>
               <EEE>eee3</EEE>
          </BBB>
     </AAA>

* {border: solid red}
AAA {display: table}
BBB {display: table-row}
CCC {display: table-cell}
DDD {display: table-cell}
EEE {display: table-cell}
View output