• 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 of the column values? If not, the table may be stretching the columns to make up for the extra width that the table has in its width property.

Some browsers will not make an empty table cell a given width. Web developers came up with the trick of stretching a one pixel GIF to the desired width to force a table cell to be the correct width. If you use a one by one pixel GIF that is transparent it will take up hardly any download time and will not be seen by the viewers.

Q2:Are pixel values or percent 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 width is smaller than the width of the table, the viewer will have to scroll horizontally to view the entire table. Horizontal scrolling is not desirable. If you use percent 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 may need to mandate a certain screen resolution to view the table. Be aware that some people on the Web disapprove of this type of mandate.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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