Curriculum
Course: Ncert-Class 10 computer science
Login

Curriculum

Ncert-Class 10 computer science

Text lesson

Short Answer -Class 10- Computer Science-Chapter 2- HTML

 Short Answer -Class 10- Computer Science-Chapter 2- HTML

Q1.Which attributes are used to give border to a table ?

Ans: The attributes which are used to give border to a table are:

border — This attribute tells the table how large the border should be.

frame — This attribute is used with border attribute and it allows the user to state which portions of the border will be displayed by the browser.

rules — It is used with border attribute and it allows the user to state which portions of the inside border edges will be displayed.

bordercolor — This attribute is used to specify the color of a table’s border.

Q2. How can you specify following in a table :

(i) background image

(ii) background colour

(iii) table height

(iv) table width ?

Ans:(i) background attribute is used to specify the background image in a table.

(ii) bgcolor attribute is used to specify the background color in a table.

(iii) height attribute is used to specify the height of a table.

(iv) width attribute is used to specify the width fo a table.

Q3. How do you create different table section ?

Ans:The <THEAD>, <TBODY> and <TFOOT> tags are used to divide HTML tables in different sections. While the <THEAD> and <TFOOT> tags define the header and footer sections , the <TBODY> tag defines the body section of the table.

Consider the following example:

<HTML>

<BODY>

<TABLE>

<THEAD BGCOLOR = “PINK”>

<TR>

<TD> Header </TD> <TD> Header </TD>

</TR>

</THEAD>

<TBODY BGCOLOR = “YELLOW”>

<TR>

<TD> Body cell data </TD> <TD> Body cell data </TD>

</TR>

<TR>

<TD> Body cell data </TD> <TD> Body cell data </TD>

</TR>

</TBODY>

<TFOOT>

<TR>

<TD> Footer </TD> <TD> Footer </TD>

</TR>

</TFOOT>

</TABLE>

</BODY>

</HTML>

Q4. Write code to produce following HTML table :

A

B

C

Ans:

<HTML>

<BODY>

<TABLE>

<TR> <TD ROWSPAN = “2”> A </TD> <TD> B </TD> </TR>

<TR> <TD> C </TD> </TR>

</TABLE>

</BODY>

</HTML>

 

 

 

×

Cart