Dr. Website

Specifying Typefaces Without Using Tags in Each Cell on a Page

Dear Dr. Website®: I use tables in most of my Web pages to help control the layout. Is there an easy way to set the font attributes for every cell in a table, or is it really necessary to put a <FONT> tag in each and every cell? If you're using <FONT> tags to specify preferred typefaces or change text attributes like size, it is indeed necessary to use opening and closing <FONT> tags in each table cell. You won't be able to consistently achieve the effect you're looking for by putting a <FONT> tag around the entire table, or setting the base font with a <BASEFONT> tag when your page has tables in it.

One solution for achieving the types of effects you're looking for without burdening your HTML files with extra <FONT> tags for every cell is to use style sheets. With style sheets, you can use a single line of code to specify type attributes for text in tables for an entire site, if you wish. The line might look something like the following: TABLE { font-family: Arial, Helvetica, sans-serif } One extensive resource on style sheets is the Web Design Group's Cascading Style Sheets page. Until style sheets are more widely deployed, however, many Web designers are continuing to use <FONT> tags. Luckily, there are workarounds for reducing the amount of grunt work involved in placing so many <FONT> tags in tables.

For example, if you format tables with a helper application like Microsoft's Internet Assistant for Excel, it can automatically add your <FONT> data to your table cells without any manual formatting on your part.

Search Engines and PDF Files

Dear Dr. Website®: We have a large number of reports and white papers on our site that are available as PDF files. We're now looking into obtaining a search engine for our site--ideally, one that would be able to index both HTML and PDF files. Do you know if there are any search engines that can catalog information in PDF files? Adobe, the maker of the PDF (Portable Document Format) file format, says that there are several search engines that support searching of PDF files on the Web, including ones from Open Text Corp., Verity Inc., and PLS Inc. You can find a page on Adobe's site listing these search engine providers at Searching PDF Files on the Web.

Quote Marks in Fill-in Fields

Dear Dr. Website®: I'm trying to make some default text appear in a fill-in box in a form. I know I'm supposed to specify this default text within a pair of quotes, like this:
<input type=text name=field
name size=25 value="default text">

The problem is that my default text phrase also includes a pair of quotes within it. How can I get the browser to recognize the quotes around the whole string of text and not get mixed up by the quotes in the text itself? There are a couple of ways you can get your text to display properly, quotes and all. First, you could replace the double quotes in your default text with the appropriate character entity code (") as follows:
<input type=text value=
"This is my "&quot;"default
text"&quot;">

Another solution is to use the double quotes in your default text but use single quotes around the entire text string, as follows:
<input type=text value=
'This is my "default
text"'>

In this case, you'd need to make sure that single quotes did not appear anywhere in your default text--for instance, in a contraction.



Reprinted from Web Week, Volume 3, Issue 7, March 24, 1997 © internet.com Corporation All rights reserved. Keywords: html Date: 19970324

http://www.internet.com