HTML and CSS Reference
In-Depth Information
Figure 14.14 Testing the CSS classes.
14.7.1 Styling a Simple Table with Class
A class can be applied to tables as with any other element. By default the browser deter-
mines the size of the table cells based on the elements and text they contain and expands
the cells accordingly. With images, the edge of the image will be the edge of the cell. The
browser will not shrink the image to fit the text, but will stretch the text to fit the image.
Text is stretched out until the first line break or until a paragraph ends. You can specify
table width with the CSS width property. Example 14.14 uses both a table and an image
width class.
EXAMPLE 14.14
<html>
<head><title>Bengaluru, India</title>
1
<style type="text/css">
2
table, td{ border:groove darkgreen; }
3
.size{ width:200px; }
/* class */
4
.caption { font-size: .8em;font-style:italic; }
</style>
</head>
 
 
Search WWH ::




Custom Search