• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Q&A

Q1:When I set a column width to a certain value, such as 50 pixels, why doesn't the column display at that value in the browser?
A1: Have you set the width of the entire table to a value that is the sum of all the column values? If not, the table might be stretching the columns to make up for the extra width that the table has in its width attribute.

Some browsers do not make an empty table cell a given width. Web devel opers came up with the trick of stretching a 1-pixel GIF, called a spacer image, to the desired width to force a table cell to be the correct width. If you use a spacer image, it will require hardly any download time and will not be seen by the viewers.

You'll learn about more about spacer images in Hour 13.

Q2:Are pixel values or percentage values better to use with tables?
A2: It depends. If you want your table to always appear the same size, use pixel values. However, if the browser window is narrower than the table, the viewer will have to scroll horizontally to view the entire table. Horizontal scrolling is not desirable. If you use percentage values in your table, it's much harder to predict what the final table is going to look like in the viewer's browser. If you use tables with pixel values, you might need to mandate a certain screen resolution to view the table. Be aware that some people disapprove of this type of mandate on the Web.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint