Nested css table : table « Tags « HTML / CSS






Nested css table

    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
  <head>
    <title>Welcome to Company</title
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<style type='text/css'>

#wrapper {
  position: relative;
  text-align: left;
  width: 760px;
  margin-right: auto;
  margin-left: auto;
}
#header {
  height: 180px;
  background-image: url(images/header.jpg);
  background-repeat: no-repeat;
  padding-bottom: 10px;
}
#main {
  display: table;
  border-collapse:collapse;
}
#nav {
  width: 180px;
  display: table-cell;
  background-color: #e7dbcd;
}
#content {
  display: table-cell;
  width: 560px;
  padding-left: 10px;
}
#footer {
  border-top: 2px solid #d7ad7b;
  background-color: #e7dbcd;
  font-size: 80%;
  padding: 0.2em 10px 0.2em 0;
  text-align:right;
}
h1 {
  font-size: 150%;
  font-weight: normal;
  padding-bottom: 0.4em;
  color: #5a3811; 
}
p {
  font-size: 80%;
  line-height: 1.6em; 
  padding-bottom: 1em;
} 
a:link, a:visited {
  color: #5a3811; 
  background-color: transparent;
}
#nav ul {
  list-style: none;
}
#nav li {
  font-size: 80%;
  width: 180px;
}
#nav a:link, #nav a:visited {
  text-decoration: none;
  color: #5a3811;
  background-color: transparent;
  display:block;
  padding: 0.3em 10px 0.3em 10px;
  border-bottom: 4px solid #d7c9b9;
}
#nav a:hover {
  border-bottom: 4px solid #fff;
}
.promo {
  display: table;
  width: 560px;
  border: 2px solid #5a3811;
  border-collapse:collapse;
  margin-bottom: 1em;
}
.promo .arrivals {
  width: 160px;
  display: table-cell;
  border: 2px solid #5a3811;
  padding: 10px;
  background-color: #e7dbcd;
}
.promo .news {
  width: 340px;
  display: table-cell;
  border: 2px solid #5a3811;
  padding: 10px;
}
.promo h3 {
  font-size: 110%;
  font-weight: normal;
  color: #5a3811;
}
.promo ul {
  list-style:none;
}
.promo p, .promo li {
  font-size: 75%;
}
</style>

  </head>
  <body>
    <div id="wrapper">
      <div id="header"></div>
      <div id="main">
        <div id="nav">
          <ul>
            <li><a href="#">A</a></li>
            <li><a href="#">H</a></li>
            <li><a href="#">S</a></li>
            <li><a href="#">P</a></li>
            <li><a href="#">B</a></li>
          </ul>
        </div>
        <div id="content">
          <h1>Company</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus rhoncus ultrices
             neque. Donec sem risus, convallis ut, interdum a, auctor egestas, sem. Aenean cursus.
             Suspendisse non erat nec ante mollis pretium. Pellentesque mollis. Fusce est. Integer 
             sed diam at orci euismod tristique. Integer feugiat. Sed posuere erat interdum lectus. 
             Vivamus in nibh eu felis porttitor consequat. </p>
           <div class="promo">
             <div class="arrivals">
               <h3>New arrivals!</h3>
               <p>Meet our new arrivals - our baby rhino and giraffe are
                   drawing the crowds this season.</p>
             </div>
             <div class="news">
               <h3>Latest news</h3>
               <ul>
                 <li>Sed nec erat sed sem molestie congue. 
                     Cras lacus sapien, <a href="http://www.example.com">ultrices ac...</a></li>
                 <li>Aliquam egestas arcu a massa. In hendrerit
                     <a href="http://www.example.com">odio eget lectus...</a></li>
               </ul>
             </div>
           </div>
          <p>Proin ligula velit, posuere ac, ullamcorper ut, rhoncus id, mauris. Curabitur velit. 
             Nunc varius facilisis dolor. Maecenas egestas sagittis ipsum. Vestibulum ultricies 
             aliquam ante. Morbi viverra lacus vitae lacus. Duis eleifend magna sit amet mi. Lorem 
             ipsum dolor sit amet, consectetuer adipiscing elit. Donec malesuada ante vel arcu. 
             Suspendisse ac nisl a enim varius bibendum. Aenean diam urna, cursus consequat, 
             facilisis vitae, gravida quis, nisl. Suspendisse in erat sed ante dignissim faucibus.</p>
        </div>
      </div>
      <div id="footer">&copy; Company 2008 | 
        <a href="">Contact us</a>
      </div>
    </div>
  </body>
</html>

   
    
    
    
  








Related examples in the same category

1.'table' Example
2.Nested tables
3.How tables linearize
4.A basic table
5.'col' Example
6.'summary' specifies a brief description of a table
7.basic table
8.Basic table with tr, td
9.A simple XHTML table
10.table tag opens a table
11.Table inline style
12.Calendar table
13.Fixed table first column
14.Make table font bold
15.table font-family: arial, verdana, sans-serif;
16.Table style
17.table color: white;
18.Table layout
19.Table styling
20.Table with shading colors
21.HTML markup for a simple table (continued)
22.providing table alignment and spacing
23.A table with spanned rows and columns
24.Img in a table cell
25.Table with summary
26.Using th for table heading
27.Dividing a table into head, body and footer.
28.A Basic Table with Caption
29.Using the table header attribute
30.table line-height: 1.3em;
31.table padding: 0;
32.table color: #fff;
33.table table-layout: fixed;
34.table caption-side: bottom;
35.HTML markup for a simple table
36.Vertical alignment in table cells
37.Styling table columns
38.A Basic Table 2
39.Adding Text Alignmnet for table
40.Stripe the table
41.Structural Table
42.CSS Table Rowspan Demo
43.Spreadsheet data
44.Fixed Table
45.Shrinkwrapped Table
46.All table content is enclosed within the tbody
47.Style for table body
48.Horizontal Stretched Table
49.Using the th element for table headings
50.Table heads, bodies and footers
51.An Accessible Table
52.Selecting cells in body
53.Selecting all tables and cells
54.Selecting all cells
55.'align' specifies the horizontal alignment of the 'table' and 'iframe'