Controlling Line Breaks in a Cell
Unless you specify otherwise, a browser will divide the lines of text in a cell as it decides on the height and width of each column and row. The nowrap attribute forces the browser to keep all the text in a cell on one line.
Figure 16.65. If one of your cells has a two word entry just a little bit bigger than the others, you may want to avoid the text wrap so the numerical data looks more uniform.
To keep text in a cell on one single line:
In a td or th cell, type nowrap= "nowrap".
Figure 16.66. Just add the nowrap attribute to the TD cell that should not be broken into multiple lines.
Figure 16.67. No matter how narrow the window and the table get, the cell's contents will stay on a single line, even if it means some of the table extends beyond the window.
images/U2713.jpg border=0> Tips
Speeding up Table Display
Although tables are extremely powerful, they can be very slow to appear in your visitor's browser. The major factor is that the browser must calculate the width and height of the table before it can begin to display the cells. So, if you can keep the browser's calculations to a minimum, the table will appear more quickly and your visitors may actually wait to see it.
To speed up table display:
Up to now, all the (X)HTML you have learned has helped you communicate your ideas with your visitors. In this chapter, you'll learn how to create forms which enable your visitors to communicate with you.
There are two basic parts of a form: the collection of fields, labels, and buttons that the visitor sees on a page and hopefully fills out, and the processing script that takes that information and converts it into a format that you can read or tally.
Constructing a form's fields and buttons (pages 254276) is straightforward and similar to creating any other part of the Web page. You can create text boxes, special password boxes, radio buttons, checkboxes, drop-down menus, larger text areas, and even clickable images. You will give each element a name that will serve as a label to identify the data once it is processed. I'll also show you how to format forms with CSS.
Processing the data from a form is only slightly more complicated. While in earlier editions I recommended using Perl to write CGI scripts, I now heartily recommend using PHP. It is easy and straightforward and perfectly suited to making Web pages interactive.
While both PHP and Perl are beyond the scope of this book, and even explaining how to use existing scripts stretches the limits a bit, I have provided some ready-made scripts to help you get started (see pages 256 and 258).