Two Column Layout in HTML with table : Two columns « Layout « HTML / CSS






Two Column Layout in HTML with table

   
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitionalt//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Two Column Layout in HTML</title>
    <style rel="stylesheet" type="text/css">
table {
  background-color: #ffffff;
  border-style: solid;
  border-width: 1px;
  border-color: #666666;
}
.header {
  background-color: #f3f3f3;
  padding: 3px;
}

.nav {
  font-weight: bold;
  background-color: #e3e3e3;
  padding: 5px;
}

.content {
  padding: 10px;
}

</style>
  </head> 
  <body>
    <table width="700" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td class="header" colspan="2"><h1>My Company Name</h1></td>
      </tr>
      <tr>
         <td class="nav" valign="top" width="100">
         <a href="">Home</a><br /><a href="">Products</a><br /><a href="">Services</a><br /><a href="">About Us</a><br /><a href="">Contact Us</a>
        </td>
        <td class="content">

        <h2>Sample Web Page</h2>
           <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc eleifend, erat id 
           commodo placerat, nulla purus bibendum justo, in dictum orci mi vitae nulla. Nullam 
           semper viverra nulla. Sed lacinia feugiat eros. Maecenas ullamcorper ligula quis odio. 
           Donec pede massa, pharetra sit amet, accumsan a, iaculis egestas, lectus. Etiam 
           ullamcorper elementum wisi. Etiam et felis aliquet dui tempus sagittis. Donec dapibus 
           ipsum id leo. Integer est ante, imperdiet non, suscipit sit amet, varius a, sem. Integer 
           lobortis wisi id erat. Nullam aliquet augue ac elit. Nulla facilisi. Vivamus ligula 
           tortor, molestie at, accumsan quis, semper vitae, augue. Praesent pede neque, sollicitudin 
           non, facilisis sed, viverra a, pede. Cras nec urna. Curabitur ut metus. Curabitur erat 
           lacus, tempus vitae, elementum nec, pulvinar vel, leo. Sed a velit. Proin erat. Donec 
           sem. </p>


        </td>
      </tr>
    </table>
  </body>
</html>

   
    
  








Related examples in the same category

1.2 column with left content floats left
2.Two columns with a footer
3.Head and footer with two columns in between
4.Header bar, two columns, menu on the right
5.2-column Layout with total width 922px, and float right
6.2-column with total width 922 px and left column 678 px, float right
7.2-column with total width 922px, left width 200px, float right
8.2-column layout with margin in between
9.2-column, with float left and right, left 678px width
10.2-column with relative positioned right column
11.Two column: content and right bar
12.Two column with negative margin
13.Floated Two Column Layout
14.Two columns with separator
15.Two columns with background
16.Two columns with width: 50%
17.Two columns with header banner
18.Two row layout: one floats left, one floats right
19.Header and sub header with two columns and footer
20.float left and right with other content
21.Two columns with header and footer
22.Two columns
23.Master header and two columns
24.Floated Two-Column Layout 2
25.Header and two-column layout
26.Two Columns Layout Using CSS
27.Two column layout with red theme
28.Two column layout template to illustrate all
29.Two column layout to illustrate all
30.Two column layout template 2
31.Two column layout template 3
32.Two column with text header
33.Two-column with sidebar layout
34.Two-column layout with header and footer
35.Two even columns