Friday, November 11, 2022

table of html tags | Definition | Attributes | Question

table in html


 Table in HTML

Tables are defined with <table> tag. A table is divided into row ( with <tr> tag ) and each row is divided into data cells ( with the <td> tag ). The lestters td stands for "Table Data " which is content of a data cell. A data cell can contain text , images , lists , paragraphs, forms , horizontal rules , tables etc.

Table Tab Exam HTML

<html>

<body>

<table border="1">

<tr>

<td> Row 1 , Cell 1 </td>

<td> Row 1 , Cell 2 </td>

</tr>

<tr>

<td> Row 2 , cell 1 </td>

<td> Row 2 , cell 2 </td>

</body>

</html>

Table Row in HTML 

The horizontal lines present in table are called as table row. To represent table row , we use tr tag. It is aa paired tag.
Syntax     <tr>.............</tr>

Cells HTML

Each row consist of a number of cells. Each defined by tag. The tag look <td>. The intersection of row and colume are called as cells. To represent table data we use td tag.
Syntax- <td>....................</td>

Tables and Border Attributes in HTML

If you. Do not specify a border attribute the table will be displayed without any border. Sometimes this can be useful , but most of the time , you want the border to show.
To display a table with border you will have to use the border attribute.
Exam 
            <table border="1">
            <tr>  <td>.............</td>
            </tr>
            </table>

Heading in a table Html

Heading in a table are defined with the <tr> tag.
Exam
            <table border="1">
            <tr> Heading 1</tr>

Table Tag Attributes in HTML

Tag Description
<table> Define a table
<th> Define a table heading
<tr> Define a table row
<td> Define a table cell
<caption> Define a table caption
<clogroup> Define group of table columns
<col> Define the attribute value for one or more columns in a tables
<thead> Define a table head
<tbody> Define a table body
<tfoot> Define a table footer

Table Tag Attributes

Attributes Paramenters
Border Pixels
bordercolor any color/ color code(hex)
bgcolor any color / color code (hex)
background image path
height pixel
width pixel
align Left , Right , Centre
valign top , middle , bottom

mcq on html

1. In Html tables table row is defined by.
    A. <tr> tag
    B. <th> tag
    C. <td> tag
    D. <row> tag
2. In Html tables gap between two cell of same tables are know as.
    A. cell spacing
    B. cell difference
    C. cell padding
    D. all of above
3. In Html tables table header is defined by.
    A. <th> tag
    B. <tr> tag
    C. <td> tag
    D. <thead> tag
4. If you want to merge two or more rows in a table which attributes you can use?
    A. Rowmerge
    B. Rowspan
    C. Colmerge
    D. Colspan
5. Whhich of following element is used for creating a separate table footer?
    A. <footer>
    B. <sepfooter>
    C. <tfoot>
    D. None of them
6. For adding style in HTML tables we can use properties of?
    A. J-Query
    B. CSS
    C. JAVA
    D. Php
7. In HTML tables space between cell content and cell border is called.
    A. Cell sepacing
    B. Cell difference
    C. Cell padding
    D. All of above
8. In Html tables tables data or cell defined by .
    A. <th> tag
    B. <tr> tag
    C. <td> tag
    D. <tdata> tag
9.Which tag allow you to add a row in a table?
    A. <td> and </td>
    B. <cr> and </cr>
    C. <th> and </th>
    D. <tr> and </tr>
10. Which attributes you'll use with TD tag to merge two cells horizontally?
    A. merge=colspan 2
    B. rowspan=2
    C. colspan=2
    D. merge=row2 
















No comments: