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.
<head><title>Bengaluru, India</title>
<style type="text/css">
table, td{ border:groove darkgreen; }
.size{ width:200px; }
/* class */
.caption { font-size: .8em;font-style:italic; }
Search WWH ::

Custom Search