Skip to main content

Attributes of TR Tag in HTML Tables

Use Of TR Tag




<TR> tag is used to create rows in HTML Tables. <TR> is the opening tag to start a row and </TR> is a closing tag to end a row. You can place pairs of <td>...</td> tags to create data cells in a row within the <tr>...</tr> tags.
for example to create a row with only one cell containing data "Apples", we will use the following html code.and Mangoes respectively:
<tr>
<td>Apples</td>
</tr>
Apples
If you want to create a row with two cells containing data "Apples" and "Mangoes" respectively, we will use the following html code.
<tr>
<td>Apples</td>
<td>Mangoes</td>
</tr>
Apples Mangoes
You canm also create a header row with the help of <TR> tag and <TH> tags. For example, to create a header row with two header cells with contents "Employee" and "Salary", we will use the following HTML coding:
<tr>
<th>Employee</th>
<th>Salary</th>
</tr>
Employee Salary

Attributes of TR Tag

1. align


It is used to define the horizontal alignment of text in cells, in a particular row. The possible values are:
left: The text is aligned to the left.
center: The text is centered.
right: The text is aligned to the right.
justify: The text is justified to both, left and right, margins.
Example HTML code
<table border="1">
<tr align="right">
<td width="100">Salary</td>
<td width="100">10000</td>
</tr>
</table>
Salary 10000

2. valign

It defines vertical alignment of the text with in cells in a row. Possible values are:
    top: The text is aligned to the top.
    middle: The text is vertically centered. This is the default value.
    bottom: The text is aligned to the botom.
  

3. bgcolor

It defines the background color that will be used as background of all the cells inside the row.
For example, if we use <tr bgcolor="green">, all cells in this row will have a green background as shown below.
<table border="1">
<tr bgcolor="green">
<td>Apple</td>
<td>Banana</td>
<td>mango</td>
</tr>
</table>
Apple Banana mango

Comments

Popular posts from this blog

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

What are Different Types of Input Devices With Examples

Topic: Different types of input devices of a computer system with examples, pictures and explanation:  Topics Covered are: Definition of Input Devices Functions of Input Devices ( How input devices work? ) Examples of Input Devices Pictures / Images of different input devices Different Examples of Input Devices With Description Keybboard Mouse Trach Ball Trackpad Joy Stick Light Pen Microphone Scanner Graphic Tablet ( Digitizer ) Digital Camera Touch Screen ( I/O Device / Dual Device - Perform Both Functions input + Output ) INPUT DEVICES ( Definition ) Input devices are used to enter data and instructions into computer memory from external world. Input Device is a hardware part of the computer that is used to enter data and instructions into computer memory. The examples of input devices include: Keyboard, Mouse , Track ball, Track Pad, Joy stick, Touch Screen, Light pen,   Scanner , Digital Camera, Microphone, Graphics tablet e...

Explain Different Types Of Output Devices

Output devices Out put devices are used to display results of processing to the user. They perform the following functions:  Receive results from memory  Convert data into human readable form  Display results to the user Examples include: Monitor, printer, plotter, speaker, and multimedia projector. Different Types of Output Devices 1.    Monitor LCD Monitor CTR Monitor     Monitor is the most commonly used output device used to display results of processing. It has a TV like shape. Pictures on monitor are formed with picture elements called PIXEL. Monitors may be Monochrome that will display results in Black & White. Color Monitors are also available. They display results in multi colors. Monitor produces soft copy output. 2.    Printers Printers are used to produce hard copy out put. They print processing results on paper. Printers are divided into two main categories: · ...