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 ...

    Discuss Differences Between RAM and ROM

    We have already discussed the topics: 1. What is RAM, Explain Different Types of RAM 2. What is ROM Explain Different Types of ROM Here we discuss differences between RAM and ROM 13 Differences Between RAM and ROM Thirteen Differences Between RAM and ROM Sr # RAM ROM 1 RAM stands for Random Access Memory ROM stands for Read Only Memory. 2 RAM is a temporary memory. ROM is a permanent memory. 3 RAM is a volatile memory. ROM is a non volatile memory. 4 When computer is turned off, all data and programs are erased from RAM.  When computer is turned off, all data and programs are retained in ROM. 5 RAM is a Read / Write memory. Data can be read and written to RAM. ROM is a read only memory. Data from ROM only can be read and not written. 6 Data and programs in RAM can be changed. The contents of ROM cannot be changed. 7 Dat...