SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
www.eshikshak.co.in
Tables are very useful to arrange in HTML
and they are used very frequently by almost all
web developers.
 Tables are just like spreadsheets and they are
made up of rows and columns.
Create a table in HTML/XHTML by using
<table> tag.


          www.eshikshak.co.in
www.eshikshak.co.in
Table heading can be defined using <th>
element.
This tag will be put to replace <td> tag which
is used to represent actual data.




          www.eshikshak.co.in
www.eshikshak.co.in
There are two attributes called cell padding
and cell spacing which you will use to adjust
the white space in your table cell..
Cell spacing defines the width of the border.
While cell padding represents the distance
between cell borders and the content within.



          www.eshikshak.co.in
<table border="1" cellpadding="5"
cellspacing="5">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>                                                  Name            Salary
<tr>                                          Ramesh Raman      5000
<td>Prakash Khaire</td>
                                              Shabbir Hussein   7000
<td>5000</td>
</tr>
<tr>
<td>Hardik Vyas</td>
<td>7000</td>
</tr>
</table>


                        www.eshikshak.co.in
Use colspan attribute if you want to merge
two or more columns into a single column.
Use rowspan if you want to merge two or
more rows.




         www.eshikshak.co.in
<table border="1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>                         Column 1 Column 2 Column 3
</tr>                                    Row 1 Cell Row 1 Cell Row 1 Cell
<tr><td rowspan="2">Row 1 Cell           1            2
                                                      Row 2 Cell 3
                                                                 Row 2 Cell
1</td>                                   Row 3 Cell 1 2          3
<td>Row 1 Cell 2</td><td>Row 1 Cell
3</td></tr>
<tr><td>Row 2 Cell 2</td><td>Row 2
Cell 3</td></tr>
<tr><td colspan="3">Row 3 Cell
1</td></tr>
</table>


                   www.eshikshak.co.in
Set table background using of the following
two ways:
 Using bgcolor attribute - You can set background
  color for whole table or just for one cell.
 Using background attribute - You can set
  background image for whole table or just for one
  cell.



           www.eshikshak.co.in
<table border="5" bordercolor="green" bgcolor="gray">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
                                                                 Column 1 Column 2 Column 3
</tr>
<tr><td rowspan="2">Row 1 Cell 1</td>                           Row 1 Cell 1 Row 1 Cell 2 Row 1 Cell 3
<td bgcolor="red">Row 1 Cell 2</td><td>Row 1 Cell 3</td></tr>                Row 2 Cell 2 Row 2 Cell 3
<tr><td>Row 2 Cell 2</td><td>Row 2 Cell 3</td></tr>             Row 3 Cell 1
<tr><td colspan="3">Row 3 Cell 1</td></tr>
</table>




                             www.eshikshak.co.in
set a table width and height using width and
height attributes.
You can specify table width or height in terms
of integer value or in terms of percentage of
available screen area.




          www.eshikshak.co.in
<table border="1" width="400" height="
150">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>                  Row 1, Column 1   Row 1, Column 2
</tr>                                     Row 2, Column 1   Row 2, Column 2
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>


                    www.eshikshak.co.in
The caption tags will serve as a title or
 explanation and show up at the top of the
 table.
<table border="1">
<caption>This is the
caption</caption>                          This is the caption
<tr>                                   row 1,        row 1,
<td>row 1, column 1</td>               column 1      columnn 2
<td>row 1, columnn 2</td>
</tr>
</table>

                 www.eshikshak.co.in
Tables can be divided into three portions:
 a header
 a body
 a foot
The head and foot are rather similar to headers
and footers in a word-processed document that
remain the same for every page, while the
body is the main content of the table.

             www.eshikshak.co.in
The three elements for separating the head,
body, and foot of a table are:
 <thead> - to create a separate table header.
 <tbody> - to indicate the main body of the table.
 <tfoot> - to create a separate table footer.




            www.eshikshak.co.in
<table border="1" width="100%">
<thead>
<tr>
<td colspan="4">This is the head of the table</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">This is the foot of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
</table>


         www.eshikshak.co.in
This is the head of the table
This is the foot of the table
Cell 1                     Cell 2
...more rows here containing four cells...
Cell 1                     Cell 2
...more rows here containing four cells...




   www.eshikshak.co.in

Weitere ähnliche Inhalte

Was ist angesagt?

Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
eShikshak
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
Aarti P
 

Was ist angesagt? (20)

Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Web Technology Lab File
Web Technology Lab FileWeb Technology Lab File
Web Technology Lab File
 
Html ppt
Html pptHtml ppt
Html ppt
 
html-css
html-csshtml-css
html-css
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
Html presentation
Html presentationHtml presentation
Html presentation
 
Html ppt
Html pptHtml ppt
Html ppt
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
 
Html and css
Html and cssHtml and css
Html and css
 
Basic html structure
Basic html structureBasic html structure
Basic html structure
 
Html frames
Html framesHtml frames
Html frames
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Html coding
Html codingHtml coding
Html coding
 

Ähnlich wie Html table tags

HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
Doncho Minkov
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
CK Yang
 

Ähnlich wie Html table tags (20)

Table structure introduction
Table structure introductionTable structure introduction
Table structure introduction
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
 
Lecture-4.pptx
Lecture-4.pptxLecture-4.pptx
Lecture-4.pptx
 
v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptx
 
Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTML
 
Handout5 tables
Handout5 tablesHandout5 tables
Handout5 tables
 
Session3 part2
Session3 part2Session3 part2
Session3 part2
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
HTML Lecture Part 2 of 2
HTML Lecture Part 2 of 2HTML Lecture Part 2 of 2
HTML Lecture Part 2 of 2
 
Html tables
Html tablesHtml tables
Html tables
 
HTML Tables in Omeka
HTML Tables in OmekaHTML Tables in Omeka
HTML Tables in Omeka
 
Xml and xslt
Xml and xsltXml and xslt
Xml and xslt
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
 
Theme
ThemeTheme
Theme
 
Tables
TablesTables
Tables
 
table html web programing
table  html  web programingtable  html  web programing
table html web programing
 

Mehr von eShikshak

Mesics lecture 4 c operators and experssions
Mesics lecture  4   c operators and experssionsMesics lecture  4   c operators and experssions
Mesics lecture 4 c operators and experssions
eShikshak
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 

Mehr von eShikshak (20)

Modelling and evaluation
Modelling and evaluationModelling and evaluation
Modelling and evaluation
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to e commerce
Introduction to e commerceIntroduction to e commerce
Introduction to e commerce
 
Chapeter 2 introduction to cloud computing
Chapeter 2   introduction to cloud computingChapeter 2   introduction to cloud computing
Chapeter 2 introduction to cloud computing
 
Unit 1.4 working of cloud computing
Unit 1.4 working of cloud computingUnit 1.4 working of cloud computing
Unit 1.4 working of cloud computing
 
Unit 1.3 types of cloud
Unit 1.3 types of cloudUnit 1.3 types of cloud
Unit 1.3 types of cloud
 
Unit 1.2 move to cloud computing
Unit 1.2   move to cloud computingUnit 1.2   move to cloud computing
Unit 1.2 move to cloud computing
 
Unit 1.1 introduction to cloud computing
Unit 1.1   introduction to cloud computingUnit 1.1   introduction to cloud computing
Unit 1.1 introduction to cloud computing
 
Mesics lecture files in 'c'
Mesics lecture   files in 'c'Mesics lecture   files in 'c'
Mesics lecture files in 'c'
 
Mesics lecture 8 arrays in 'c'
Mesics lecture 8   arrays in 'c'Mesics lecture 8   arrays in 'c'
Mesics lecture 8 arrays in 'c'
 
Mesics lecture 7 iteration and repetitive executions
Mesics lecture 7   iteration and repetitive executionsMesics lecture 7   iteration and repetitive executions
Mesics lecture 7 iteration and repetitive executions
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 6   control statement = if -else if__elseMesics lecture 6   control statement = if -else if__else
Mesics lecture 6 control statement = if -else if__else
 
Mesics lecture 4 c operators and experssions
Mesics lecture  4   c operators and experssionsMesics lecture  4   c operators and experssions
Mesics lecture 4 c operators and experssions
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
 
Lecture 7 relational_and_logical_operators
Lecture 7 relational_and_logical_operatorsLecture 7 relational_and_logical_operators
Lecture 7 relational_and_logical_operators
 
Lecture21 categoriesof userdefinedfunctions.ppt
Lecture21 categoriesof userdefinedfunctions.pptLecture21 categoriesof userdefinedfunctions.ppt
Lecture21 categoriesof userdefinedfunctions.ppt
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Html table tags

  • 2. Tables are very useful to arrange in HTML and they are used very frequently by almost all web developers. Tables are just like spreadsheets and they are made up of rows and columns. Create a table in HTML/XHTML by using <table> tag. www.eshikshak.co.in
  • 4. Table heading can be defined using <th> element. This tag will be put to replace <td> tag which is used to represent actual data. www.eshikshak.co.in
  • 6. There are two attributes called cell padding and cell spacing which you will use to adjust the white space in your table cell.. Cell spacing defines the width of the border. While cell padding represents the distance between cell borders and the content within. www.eshikshak.co.in
  • 7. <table border="1" cellpadding="5" cellspacing="5"> <tr> <th>Name</th> <th>Salary</th> </tr> Name Salary <tr> Ramesh Raman 5000 <td>Prakash Khaire</td> Shabbir Hussein 7000 <td>5000</td> </tr> <tr> <td>Hardik Vyas</td> <td>7000</td> </tr> </table> www.eshikshak.co.in
  • 8. Use colspan attribute if you want to merge two or more columns into a single column. Use rowspan if you want to merge two or more rows. www.eshikshak.co.in
  • 9. <table border="1"> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> Column 1 Column 2 Column 3 </tr> Row 1 Cell Row 1 Cell Row 1 Cell <tr><td rowspan="2">Row 1 Cell 1 2 Row 2 Cell 3 Row 2 Cell 1</td> Row 3 Cell 1 2 3 <td>Row 1 Cell 2</td><td>Row 1 Cell 3</td></tr> <tr><td>Row 2 Cell 2</td><td>Row 2 Cell 3</td></tr> <tr><td colspan="3">Row 3 Cell 1</td></tr> </table> www.eshikshak.co.in
  • 10. Set table background using of the following two ways:  Using bgcolor attribute - You can set background color for whole table or just for one cell.  Using background attribute - You can set background image for whole table or just for one cell. www.eshikshak.co.in
  • 11. <table border="5" bordercolor="green" bgcolor="gray"> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> Column 1 Column 2 Column 3 </tr> <tr><td rowspan="2">Row 1 Cell 1</td> Row 1 Cell 1 Row 1 Cell 2 Row 1 Cell 3 <td bgcolor="red">Row 1 Cell 2</td><td>Row 1 Cell 3</td></tr> Row 2 Cell 2 Row 2 Cell 3 <tr><td>Row 2 Cell 2</td><td>Row 2 Cell 3</td></tr> Row 3 Cell 1 <tr><td colspan="3">Row 3 Cell 1</td></tr> </table> www.eshikshak.co.in
  • 12. set a table width and height using width and height attributes. You can specify table width or height in terms of integer value or in terms of percentage of available screen area. www.eshikshak.co.in
  • 13. <table border="1" width="400" height=" 150"> <tr> <td>Row 1, Column 1</td> <td>Row 1, Column 2</td> Row 1, Column 1 Row 1, Column 2 </tr> Row 2, Column 1 Row 2, Column 2 <tr> <td>Row 2, Column 1</td> <td>Row 2, Column 2</td> </tr> </table> www.eshikshak.co.in
  • 14. The caption tags will serve as a title or explanation and show up at the top of the table. <table border="1"> <caption>This is the caption</caption> This is the caption <tr> row 1, row 1, <td>row 1, column 1</td> column 1 columnn 2 <td>row 1, columnn 2</td> </tr> </table> www.eshikshak.co.in
  • 15. Tables can be divided into three portions:  a header  a body  a foot The head and foot are rather similar to headers and footers in a word-processed document that remain the same for every page, while the body is the main content of the table. www.eshikshak.co.in
  • 16. The three elements for separating the head, body, and foot of a table are:  <thead> - to create a separate table header.  <tbody> - to indicate the main body of the table.  <tfoot> - to create a separate table footer. www.eshikshak.co.in
  • 17. <table border="1" width="100%"> <thead> <tr> <td colspan="4">This is the head of the table</td> </tr> </thead> <tfoot> <tr> <td colspan="4">This is the foot of the table</td> </tr> </tfoot> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> ...more rows here containing four cells... </tr> </tbody> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> ...more rows here containing four cells... </tr> </tbody> </table> www.eshikshak.co.in
  • 18. This is the head of the table This is the foot of the table Cell 1 Cell 2 ...more rows here containing four cells... Cell 1 Cell 2 ...more rows here containing four cells... www.eshikshak.co.in