eHow launches Android app: Get the best of eHow on the go.

How To

How to Define Groups of Table Columns in HTML

Contributor
By eHow Contributing Writer
(1 Ratings)

Tables in HTML are used to provide a matrix of rows and columns, with each cell holding its own value. By defining several columns as belonging to a group, you can set formatting for all those columns at one time, and define where vertical rules appear.

Difficulty: Moderately Easy
Instructions

Things You'll Need:

  • Text editor

    Create the Table

  1. Step 1

    Open the web page you'll be editing and insert your cursor in the place you want the table to appear.

  2. Step 2

    Type the following:

  3. Step 3

    Replace the "1" with a number representing the desired thickness of the table's borders. If you don't want borders to appear at all, simply leave out the "border" notation and number.

  4. Define Groups of Columns

  5. Step 1

    Type the following by itself on the next line to indicate that you are defining a group of columns:

  6. Step 2

    Replace "3" with a number that represents how many columns you want to include in this group, starting from the left. Vertical rules will appear to the left of the first column in the group and the right of the last column.

  7. Step 3

    Replace "40" with a number indicating the desired width (in pixels) of the columns. The "align" attribute specifies that text in all cells in these three columns will be right-aligned.

  8. Step 4

    Write an additional column group tag for each additional group of columns that you want to define in this table.

  9. Step 5

    Continue to create

  10. and
    tags to define the cells of the table once all your column groups have been defined.

  11. Step 6

    Type

  12. to finish the definition of the table.

Tips & Warnings
  • When it comes to HTML, be precise. If you can't get the code to work, look through to ensure that all of the brackets are in place.
  • Be sure to place the element right after the element, before defining the table's header and rows.
    Subscribe

    Post a Comment

    Post a Comment

    Related Ads

    • Have you done this? Click here to let us know.
    I Did This
    Get Free Internet Newsletters

    Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

    Demand Media
    eHow_eHow Technology and Electronics