untitled

(John Hannent) #1
of calculating each cell’s size before laying out the table. However, you can
use the fixed value for the table-layoutproperty and speed things up by
specifying a maximum size for the cells. This can, however, cut off part of a
photo, as shown in Figure 12-7:

As you can see in the following code, the figure on the left (the first figure
specified in the code) is in a table with its table-layoutproperty set to
fixed. No amount of resizing the user’s browser stretches or shrinks this
figure. It’s fixed at the width specified (150 pixels here). (The height of the
table’s cell is unaffected by all this.)

<html>
<head>
<body>

<table>
<tr>
<td>

<table style=”table-layout: fixed; width: 150px; border:
solid”>
<tr>
<td><img src=”thought.jpg”><br />
A friend in contemplative thought, reduced to grayscale.</td>
</tr>
</table>
</td>
<td>

<table style=”table-layout: auto;border: solid” >
<tr>

Figure 12-7:
When you
use the
fixed value
for table-
layout,
you can
cause the
contents to
be cut off,
as in the
table on
the left.


Chapter 12: Handling Tables and Lists (And Doing Away with Tables) 215

Free download pdf