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

    Explain Main Difference Between System Software and Application Software

    Topic: Explain Main Difference Between System Software and Application Software            Differentiate between system software and application software Before , explaining the main differences between application software and system software, let us know the definitions of Application software and System software with examples. What is System Software: System software is a set of programs to control all components of computer and to manage overall operations of computer system. Differences between System software and application software System software is used as a base to install and run all application software. Examples of system software include: Operating Systems, like Microsoft Windows, DOS, Unix and Linux Device Drivers like Device driver software of a Printer (found on CD normally provided with the printer) Utility Programs like AVAST anti virus, Disk Scanners and File Viewers etc. What is Applicat...

    CRT Monitors and Flat-panel LCD Monitors Differences

    Difference between CRT monitors and Flat Panel (LCD) Monitors Differences between CRT Monitors and Flat-panel (LCD) Monitors CRT Monitors Flat-panel (LCD)Monitors 1 CRT monitors are low-priced and more economical than flat-panel (LCD) monitors. Flat-panel monitors are more costly than CRT monitors. 2 Commonly, CRT monitors are used with personal computers. In the beginning LCD monitors were used in lap top or note book computers, PDAs and smart phones. But now they available for PCs, too.  3 CRT monitors use Cathode Ray Tube (picture tube) Technology to show text and graphics on screen. Flat-panel monitors use LCD - Liquid Crystal Display technology or Gas Plasma technology. 4 CRT monitors need more power. LCD monitors uses less energy than CRT monitors. 5 CRT monitors take more space on desk. LCD monitors take less space on desk top. 6 ...

    Who Invented First PC Virus? Pakistanis Invented First PC Virus in 1986

    Who Invented The First PC VIRUS-Video Proof by F-Secure two Pakistani bothers, Amjad Farooq Alvi and Basit Farooq Alvi, invented this very first PC Virus Who invented the first PC Virus? First ever PC computer virus was named as Brain. In 1986,   two Pakistani bothers, Amjad Farooq Alvi and Basit Farooq Alvi, invented this very first PC Virus. Amjad farooq Alvi and Basit farooq Alvi  are currently running an ISP under the name of Brain Telecommunication Limited, in Lahore, Pakistan. First PC virus invented by Pakistani brothers amjad and basit Mikko Hypponen travelled to Pakistan to find the writers of the first PC virus. The first virus to infect PC computers was discovered in 1986. Intriguingly, the virus contained the contact details of its authors in Pakistan. 25 years later, in February 2011, Mikko Hypponen, Chief Research Officer at F-Secure, travelled to the city of Lahore in Pakistan to find the authors . The authors were identified as brothers Amjad F...