| 
| Advanced Tables - formatting, padding and spacing |
Building Your Page Using Tables:
- put your items into the cells on your table and saving and viewing the page often
- to put both a graphic and text in the same cell here is how horizontal aligning works:
- left-aligning the graphic will bring the text up on the right side of the graphic, flush with the top of it;
- right-aligning will put the graphic on the right and the text to the left
- centering usually puts the text above or below the graphic, with both items centered in the cell (unless you have extraneous spaces - then you just get a confusing mess)
- you can also insert a 2 col x 1 row table in the cell - one holds the picture, the other holds the text (or two pics or two blurbs of text)
- sometimes with centering, the text will start on the the same line as the graphic at its lower right (or if graphic is below the text, text may end on the same line as the upper left of the graphic - this is because you have a wider cell in the same column)
- put your cursor right in front of the items you want to push up or at the end of the items you want to push down, and use the enter or shift+enter key to force the text to wrap below or above the pic
- if you use shift+enter, the alignment of everything in the cell must be the same
- if you use just the enter key to create a paragraph break between components in a cell, each component can have it's own alignment without affecting the rest
- when editing an existing table (to change borders, background, etc.), put your cursor on one edge of the table and when you see the little cross-hairs icon appear, double click to bring up the table editor; click on EDIT TABLE tab to change things in the table
| | This table has cell padding & spacing of 2, 0 borders | | This table has zero cell padding & spacing & borders |
| | | | |
| default 1:1:1 | Pad3:Spc1:Brdr1 | Pad1:Spc3:Brdr1 | |
Repairing a "broken" table (adding or deleting cells):
Need to delete a cell, column or row from a table? Have you mysteriously managed to delete a cell or otherwise mess up an existing table? Go to the html code view. Look for the TR and TD - those signify the rows and the cells within the rows in the table. Here's an example - 2x2 table - I left the spaces in the cells so the code would make more sense.
TABLE - start of table (background url would go in here)
TBODY - start of table contents
TR - first table row (this is where you also specify row height)
TD /TD - first cell in row (you can specify cell background and cell width in here too)
TD /TD - second cell in row (you can also specify 'colspan' or 'rowspan' here too)
/TR - end of first row
TR - start of second row
TD /TD - first cell in row
TD /TD - second cell in row
/TR - end of second row
/TBODY - end of table contents
/TABLE - end of table
So, if you can locate the pattern of the TD and TR items, you can use html to reinsert missing rows or cells, or to delete them, or to customize height, width, background, etc. Once you find the pattern, you will quickly spot the one that "doesn't fit" so you can make your changes to the html. In addition, putting something catchy like HERE in block caps in a cell before you go to the html view makes the problem area easier to find.
Copyright Web Design, February 2001
Updated: May 2, 2003