SlideShare a Scribd company logo
Lecture 8

In this lecture, we will learn about

    -   How to create Table
    -   Escape Sequences: Special Characters

Tables are very useful while creating HTML pages; especially tables solve the alignment
problem. A table tag has headings where you explain what the columns/rows include,
rows for information, and cells for each item. In the following table, the first two rows
contain the heading information, each detail row explains an HTML table tag, and each
cell contains a paired tag or an explanation of the tag's function.

                                       Table Elements
    Element                                       Description
<TABLE> ...      defines a table in HTML. If the BORDER attribute is present, your
</TABLE>         browser displays the table with a border.
<CAPTION> ... </ defines the caption for the title of the table. The default position of the
CAPTION>         title is centered at the top of the table. The attribute ALIGN=BOTTOM
                 can be used to position the caption below the table.
                 NOTE: Any kind of markup tag can be used in the caption.
<TR> ... </TR>   specifies a table row within a table. You may define default attributes
                 for the entire row: ALIGN (LEFT, CENTER, RIGHT) and/or VALIGN
                 (TOP, MIDDLE, BOTTOM).
<TH> ... </TH>       defines a table header cell. By default the text in this cell is bold and
                     centered. Table header cells may contain other attributes to determine
                     the characteristics of the cell and/or its contents.
<TD> ... </TD>       defines a table data cell. By default the text in this cell is aligned left
                     and centered vertically. Table data cells may contain other attributes
                     to determine the characteristics of the cell and/or its contents.

Here is the single cell table, the simplest table possible.

<CENTER>

          <table border=1>

                    <tr>

                           <td>here is a single-celled table!</td>

                  </tr>
          </table>

</CENTER>
The output on the browser is
                               here is a single-celled table!


<html>
         <head>
               <title> Using Table Tag</title>
         </head>

         <body>
               <table border=1>
                      <caption> Time Table for Mar-June 2005</caption>
                      <tr>
                             <th></th>
                             <th>Monday</th>
                             <th>Tuesday</th>
                             <th>Wednesday</th>
                             <th>Thrusday</th>
                             <th>Friday</th>
                      </tr>

                       <tr>
                               <td>9:30-10:20</td>
                               <td>-</td>
                               <td>-</td>
                               <td>-</td>
                               <td>-</td>
                               <td><font color="blue">109</font></td>
                       </tr>

                       <tr>
                               <td>10:30-11:20</td>
                               <td>-</td>
                               <td>-</td>
                               <td>-</td>
                               <td>-</td>
                               <td><font color="blue">109</font></td>
                       </tr>

                       <tr>
                               <td>11:30-12:20</td>
                               <td>-</td>
                               <td>-</td>
                               <td>-</td>
                               <td>-</td>
<td><font color="blue">109</font></td>
</tr>

<tr>
        <td>12:30-1:20</td>
        <td>-</td>
        <td>-</td>
        <td><font color="blue">312</font></td>
        <td>-</td>
        <td>-</td>
</tr>

<tr>
        <td>1:30-2:20</td>
        <td>-</td>
        <td><font color="blue">306</font></td>
        <td>-</td>
        <td>-</td>
        <td>-</td>
</tr>

<tr>
        <td>2:30-3:20</td>
        <td>-</td>
        <td><font color="blue">306</font></td>
        <td>-</td>
        <td><font color="blue">309</font></td>
        <td>-</td>
</tr>

<tr>
        <td>3:30-4:20</td>
        <td>-</td>
        <td>-</td>
        <td>-</td>
        <td><font color="blue">309</font></td>
        <td>-</td>
</tr>

<tr>
        <td>4:30-5:20</td>
        <td>-</td>
        <td>-</td>
        <td>-</td>
        <td><font color="blue">309</font></td>
        <td>-</td>
</tr>
             <table>
       </body>
</html>

                Time Table for Mar-June 2005
              Monday Tuesday Wednesday Thrusday Friday
9:30-10:20    -      -        -           -    109
10:30-11:20   -      -        -           -    109
11:30-12:20   -      -        -           -    109
12:30-1:20    -      -        312         -    -
1:30-2:20     -      306      -           -    -
2:30-3:20     -      306      -           309  -
3:30-4:20     -      -        -           309  -
4:30-5:20     -      -        -           309  -




Escape Sequences: Special Characters (a.k.a. Character Entities)

Special characters are composed of short sequence of characters that are translated by the
browser and displayed as a single character.
Special characters begin with an ampersand(&) and end with a semicolon (;), for example
&nbsp, which is used for giving spaces between words or characters

To understand &nbsp; type the following code in notepad
<html>
       <head>
              <title>Using nbsp </title>
       </head>

       <body>
             My name is Harshit                 Kumar.
       </body>
</html>

The output is
My name is Harshit Kumar.

Although I gave so many spaces between “Harhsit” and “Kumar”, still the output shows
only one space.
This means that browser shrink the spaces, so to insert spaces, we need &nbsp;.

Type the following code in notepad
<html>
       <head>
              <title>Using nbsp </title>
       </head>

       <body>
       My name is Harshit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kumar.
       </body>
</html>


The output is
My name is Harshit          Kumar.

------------------------------------------------------Finish----------------------------------------------

More Related Content

PDF
Html tables examples
PDF
Html table tags
PPTX
Tables and Forms in HTML
PPTX
HTML: Tables and Forms
PPTX
Html table
PPTX
html-table
DOCX
html file
PDF
Tables and forms with HTML, CSS
Html tables examples
Html table tags
Tables and Forms in HTML
HTML: Tables and Forms
Html table
html-table
html file
Tables and forms with HTML, CSS

What's hot (9)

PPTX
HTML Table Tags
PPT
Frames tables forms
PPTX
Lect# 1 html part ii
PPT
Tables and Forms in HTML
DOC
Html basics 9 meta background
 
DOCX
Web Technology Lab File
DOC
TYBSC prac soln
PPTX
Html 5-tables-forms-frames (1)
PPTX
14. add data in symfony4
HTML Table Tags
Frames tables forms
Lect# 1 html part ii
Tables and Forms in HTML
Html basics 9 meta background
 
Web Technology Lab File
TYBSC prac soln
Html 5-tables-forms-frames (1)
14. add data in symfony4
Ad

More from H K (20)

PDF
Assignment4
 
DOCX
Assignment3
 
PDF
Induction
 
PDF
Solution3
 
PDF
Solution2
 
DOCX
Mid-
 
PDF
Assignment4
 
PDF
Assignment4
 
PDF
Dm assignment3
 
PPT
Proof
 
PDF
Resolution
 
DOCX
Assignment description
 
PDF
Dm assignment2
 
PDF
Set
 
PDF
Dm assignment1
 
PPTX
Logic
 
DOCX
Introduction
 
PDF
Assignment 2 sol
 
PDF
Assignment sw solution
 
PDF
Violinphoenix
 
Assignment4
 
Assignment3
 
Induction
 
Solution3
 
Solution2
 
Mid-
 
Assignment4
 
Assignment4
 
Dm assignment3
 
Proof
 
Resolution
 
Assignment description
 
Dm assignment2
 
Set
 
Dm assignment1
 
Logic
 
Introduction
 
Assignment 2 sol
 
Assignment sw solution
 
Violinphoenix
 
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Computing-Curriculum for Schools in Ghana
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharma ospi slides which help in ospi learning
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Microbial diseases, their pathogenesis and prophylaxis
FourierSeries-QuestionsWithAnswers(Part-A).pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
A systematic review of self-coping strategies used by university students to ...
Microbial disease of the cardiovascular and lymphatic systems
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
Computing-Curriculum for Schools in Ghana
Weekly quiz Compilation Jan -July 25.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
STATICS OF THE RIGID BODIES Hibbelers.pdf
Final Presentation General Medicine 03-08-2024.pptx
Pharma ospi slides which help in ospi learning

Html basics 7 table

  • 1. Lecture 8 In this lecture, we will learn about - How to create Table - Escape Sequences: Special Characters Tables are very useful while creating HTML pages; especially tables solve the alignment problem. A table tag has headings where you explain what the columns/rows include, rows for information, and cells for each item. In the following table, the first two rows contain the heading information, each detail row explains an HTML table tag, and each cell contains a paired tag or an explanation of the tag's function. Table Elements Element Description <TABLE> ... defines a table in HTML. If the BORDER attribute is present, your </TABLE> browser displays the table with a border. <CAPTION> ... </ defines the caption for the title of the table. The default position of the CAPTION> title is centered at the top of the table. The attribute ALIGN=BOTTOM can be used to position the caption below the table. NOTE: Any kind of markup tag can be used in the caption. <TR> ... </TR> specifies a table row within a table. You may define default attributes for the entire row: ALIGN (LEFT, CENTER, RIGHT) and/or VALIGN (TOP, MIDDLE, BOTTOM). <TH> ... </TH> defines a table header cell. By default the text in this cell is bold and centered. Table header cells may contain other attributes to determine the characteristics of the cell and/or its contents. <TD> ... </TD> defines a table data cell. By default the text in this cell is aligned left and centered vertically. Table data cells may contain other attributes to determine the characteristics of the cell and/or its contents. Here is the single cell table, the simplest table possible. <CENTER> <table border=1> <tr> <td>here is a single-celled table!</td> </tr> </table> </CENTER>
  • 2. The output on the browser is here is a single-celled table! <html> <head> <title> Using Table Tag</title> </head> <body> <table border=1> <caption> Time Table for Mar-June 2005</caption> <tr> <th></th> <th>Monday</th> <th>Tuesday</th> <th>Wednesday</th> <th>Thrusday</th> <th>Friday</th> </tr> <tr> <td>9:30-10:20</td> <td>-</td> <td>-</td> <td>-</td> <td>-</td> <td><font color="blue">109</font></td> </tr> <tr> <td>10:30-11:20</td> <td>-</td> <td>-</td> <td>-</td> <td>-</td> <td><font color="blue">109</font></td> </tr> <tr> <td>11:30-12:20</td> <td>-</td> <td>-</td> <td>-</td> <td>-</td>
  • 3. <td><font color="blue">109</font></td> </tr> <tr> <td>12:30-1:20</td> <td>-</td> <td>-</td> <td><font color="blue">312</font></td> <td>-</td> <td>-</td> </tr> <tr> <td>1:30-2:20</td> <td>-</td> <td><font color="blue">306</font></td> <td>-</td> <td>-</td> <td>-</td> </tr> <tr> <td>2:30-3:20</td> <td>-</td> <td><font color="blue">306</font></td> <td>-</td> <td><font color="blue">309</font></td> <td>-</td> </tr> <tr> <td>3:30-4:20</td> <td>-</td> <td>-</td> <td>-</td> <td><font color="blue">309</font></td> <td>-</td> </tr> <tr> <td>4:30-5:20</td> <td>-</td> <td>-</td> <td>-</td> <td><font color="blue">309</font></td> <td>-</td>
  • 4. </tr> <table> </body> </html> Time Table for Mar-June 2005 Monday Tuesday Wednesday Thrusday Friday 9:30-10:20 - - - - 109 10:30-11:20 - - - - 109 11:30-12:20 - - - - 109 12:30-1:20 - - 312 - - 1:30-2:20 - 306 - - - 2:30-3:20 - 306 - 309 - 3:30-4:20 - - - 309 - 4:30-5:20 - - - 309 - Escape Sequences: Special Characters (a.k.a. Character Entities) Special characters are composed of short sequence of characters that are translated by the browser and displayed as a single character. Special characters begin with an ampersand(&) and end with a semicolon (;), for example &nbsp, which is used for giving spaces between words or characters To understand &nbsp; type the following code in notepad <html> <head> <title>Using nbsp </title> </head> <body> My name is Harshit Kumar. </body> </html> The output is My name is Harshit Kumar. Although I gave so many spaces between “Harhsit” and “Kumar”, still the output shows only one space.
  • 5. This means that browser shrink the spaces, so to insert spaces, we need &nbsp;. Type the following code in notepad <html> <head> <title>Using nbsp </title> </head> <body> My name is Harshit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kumar. </body> </html> The output is My name is Harshit Kumar. ------------------------------------------------------Finish----------------------------------------------