Column widths : td « Tags « HTML / CSS






Column widths

    
<?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>Column widths</title>
  <style rel="stylesheet" type="text/css">
body {
  background-color: #ffffff;
  font-family: arial, verdana, sans-serif;
  font-size: 12px;
}

p.narrow {
  width: 200px;
}

p.wide {
  width: 700px;
}
</style>
</head>
<body>
<p class="narrow">
           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>
<p class="wide">
           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>
</body>
</html>

   
    
    
  








Related examples in the same category

1.'td' Example
2.'choff' is a decimal number specifying an offset from the beginning of the table cell
3.'headers' specifies a list of 'th' elements
4.tr and td
5.Line break in a table cell
6.use table cell as block
7.Hide empty cell
8.Empty table header cell
9.Table cell hover
10.Right-offset Shrinkwrapped Table
11.Table with Spanned Rows and Cells
12.Boxed Table and Cells
13.td font-weight: bold;
14.table cell hover with class
15.td:empty
16.table cell overflow hidden
17.Selecting cells in body
18.Set style for an anchor in table cell
19.Set style for image in a table cell
20.Table cell with different class
21.Table cell with line height setting
22.Add different cell space
23.empty-cells: hide
24.td width:6em;
25.td overflow: hidden;
26.td font-size: 130%;
27.td color: #303030;
28.td font-size: 0.9em;
29.td line-height:1.5; line-height:1.5em; line-height:75%;}
30.Table with column span 2
31.Table with number column
32.css is for the table layout
33.rowspans and colspans merge the specified number of cells vertically or horizontally
34.Selecting cells in column
35.Hiding column
36.col width: 200px;
37.col color: crimson;
38.Column highlight