Sabtu, 22 Juni 2013

Table Columns HTML Tutorial

HTML tables allow your Web pages to display data in an easily readable format. They are relatively simple to set up, but they can be confusing for a beginner because while the rows of a table are clearly defined within the code, the columns are not. Don't worry. Just master a couple basic concepts, and you'll be "writing columns" in no time.

Basic Elements

    Start by setting up the basic framework. HTML tables begin and end with

    tags. The information within tables is arranged in rows, each of which is marked with tags (for "table row"). Columns are created by the tags. The number of columns is defined by the number of
    ("table data") tags within the rows. Each set of tags is called a "cell." Let's set up a basic table with the first and last names of the first three American presidents:






    No.First nameLast Name
    1GeorgeWashington
    2JohnAdams
    3ThomasJefferson

    Note that this table does not define any columns, unlike the way rows are defined with the

    cells. Here, each row has three cells, so there will be three columns. Always have the same number of cells in each row, even if you don't have a value to put in a particular cell; this is how the browser keeps the columns aligned.

    Setting Widths