Skip to main content

Attributes of Table Tag



Table Tag Attributes

  1. Border: It is used to specify a border and its thickness for a table.
  2. Cellspacing: It is used to specify the distance between adjacent cells in a table.
  3. Cellpadding: it is used to specify the distance between a cell and cell contents in a table.
  4. Width: It is used to specify width of a table in pixels or as percentage to screen width.
  5. Align: It is used to specify the horizontal alignment of a table. Possible horizontal alignment values are "left", "right" or "center".
  6. Valign: It is used to set the vertical alignment of a table as "top", "bottom" or "middle".
  7. Bgcolor: It sets the background color of a table. You can specify color names or hex values for the color.

    Example of table with border=1, width=200 and align=center attributes

    HTML Coding:

    <table border="1" width="200" align="center">
    <tr>
    <th>Book</th><th>Price($)</th>
    </tr>
    <tr>
    <td>Visual Basic</td><td>75</td>
    </tr>
    <tr>
    <td>C++</td><td>45</td>
    </tr>
    </table>

    BookPrice($)
    Visual Basic75
    C++45

    Example of table with border=5, cellpadding="10" and cellspacing="10"

    <table border="5"  cellpadding="10" cellspacing="10">
    <tr>
    <th>Book</th><th>Price($)</th>
    </tr>
    <tr>
    <td>Visual Basic</td><td>75</td>
    </tr>
    <tr>
    <td>C++</td><td>45</td>
    </tr>
    </table>
    BookPrice($)
    Visual Basic75
    C++45

     Example table with border="5" width="300" bgcolor="yellow"

    <table border="5" width="300" bgcolor="yellow">
    <tr>
    <th>Book</th><th>Price($)</th>
    </tr>
    <tr>
    <td>Visual Basic</td><td>75</td>
    </tr>
    <tr>
    <td>C++</td><td>45</td>
    </tr>
    </table>

    BookPrice($)
    Visual Basic75
    C++45

    Comments

    Popular posts from this blog

    Definition and History of ECommerce

    What do you mean by E-Commerce? Electronic Commerce (e-Commerce) is a general concept covering any form of business transaction or information exchange executed using information and communication technologies (ICTs). e-Commerce takes place between companies, between companies and their customers, or between companies and public administrations. Electronic Commerce includes electronic trading of goods, services and electronic material. BRIEF HISTORY OF E-COMMERCE + E-commerce started in early 1970’s with invention of electronic fund transfer(EFT). + Only used by large organizations, financial institutions and a few small business at that time. + After invention of EDI (Electronic Data Interchange) from financial institutions to manufacturers retailers, services and so on. + Many other e-commerce applications started from stock trading to travel reservation system. + With commercialization of internet in early 1990’s. The term electronic commerce was used. Interne...

    Explain different types of storage devices

    Topic: Explain different types of storage devices in Computer systems Storage Devices Storage devices are used to store data and instructions permanently. Storage devices are also called secondary storage devices / backing storage devices / external storage devices or auxiliary storage devices. Examples of storage devices include Hard Disk, CD and DVD etc. Why Secondary Storage Devices are Used? Secondary storage devices are used because: Primary memory(RAM) is volatile and temporary. When computer is switched off, all data in ram is erased. Storage devices can store large amounts of data and instructions permanently whereas Primary memory has less capacity of storing data. Types Of Storage Devices There are three main types of storage devices:  Magnetic Tape   Magnetic Disk   Optical Disk   Flash Memory storage devices 1. Magnetic Tape Magnetic tape is the oldest storage device. It is made of plastic coated with m...

    Important objective type questions 1-50

    FTP stand for     file transfer protocol. Lady ADA is the mother of computer.    VINT CERF     is the father of Internet. Nibble consists of   4   bits.   Google     and   Yahoo   are the two search engines. TCP/IP stands for Transmission control protocol/Internet protocol. One sector on Hard Disk holds   512    bytes.   Dos, window and UNIX are three operating systems. Demodulation converts Analog signal into Digital signal. ARPANET stands for advanced research project agency network. URL stands for uniform resource locator . Charles Babbage is the father of computer. Lady ADA is the first computer programmer. Nibble contains 04 numbers of bits. Name Two Mail service mail Yahoo.com. VOIP stands for Voice over internet protocol. One sector holds 512 numbers of bytes. N...