|
|
HTML Code TutorialTutor Ebook Download Tables in HTMLThe original purpose of tables was to present data in rows and columns on a web page. There is an ongoing controversy about whether or not they should be used to structure web pages. The truth of the matter is that most web designers still use tables to set up their pages. Why? Because it's easier than building pages without them. For beginners who want multi column web pages, tables are the easiest solution. Large complicated tables will take longer to load in a browser, but most web designers have written off the dial up user anyway. So, I ask; "Why the controversy?" Basic Table Tags
This is the basic code for the following table: (single row - 2 column)
Closing tags are required for all table related tags. Beginners should also avoid nesting tables. (Building a table within a table.) All table structures begin with the table tag. Remember the closing tag. 2 Column Web PageTake a look at the attributes listed below for the table tags. Then view this simple demonstration of how to build a 2 column web page using a table Browser CompatibilityIt should be noted here that tables are one area of HTML where browsers disagree on how code should be interpreted. It is a good practice when building pages using tables to view them in both the IE and Mozilla browser types. Greater compatibility between types can be achieved using the old method of inline settings, but even when using this method differences will occur in your display. The attributes of the table tag are:
|
Contents Table of ContentsIntroduction Page Structure Basic HTML PageDoctype The Body Tag The Header Tag The Division Tag Horizontal Rule Anchor Tag Anchor Tag - Intradocument Anchor Tag - Image Using Borders The ID Attribute Meta Tags Text Controls Style SheetsWorking With Fonts The Paragraph Tag Paragraphs-Images Using Lists The Pre Tag Line Break Tag Tables Basics of TablesColspan Rowspan Bgcolor Attribute Background Images Forms Form BasicsCheck Boxes Text Boxes Selection Boxes Frames Basic FramesTarget and Scrolling Search Engines Miscellaneous Buttons with CSSUsing Color Color Chart Using Images Using Templates Uploading HTML pages. HTML-CSS Quizzes |
Row TagThe
Cell or Column TagThe td tag is used to define the cells in a row.
Now let's change some of the code in the example and see how it affects the appearance of the table.
The changes we made were:
Column HeadingsColumn headings are placed in a separate row above the associated row of cells.
Removing the Border
This is the basic code for the following table:
Note the changes made to the code, to produce the results. Tables and TextOne of the hardest things for a beginner in HTML to do, is to
control text on a page. If you examine the source code of some web pages on
the net, you will find programmers that define almost every pixel on the page
to keep their text where they want it.
More Table TipsFor faster loading pages, build several single row tables, rather than one large complicated multi row table. Single row tables are also easier to maintain. We've used the older method of setting table attributes in our examples. You can use Inline Style Sheets for HTML 4.0 compliance. Centering Items in TablesAs of July 2006 there are still differences in the way IE and Mozilla browsers display tables. You will run into problems when trying to center items like paragraphs and lists within your tables. Here are a few suggestions that may help. Include this style setting: For lists exclude text-align:center and set left and right margins and padding to zero. This will give you the same results in both Mozilla and IE browsers. Check out our Free Frames Template Kit or try our Free Frames Kit Demo |
|
|