SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
Aarti P
 

Tendances (20)

Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
 
Id and class selector
Id and class selectorId and class selector
Id and class selector
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
 
CSS
CSSCSS
CSS
 
Html table
Html tableHtml table
Html table
 
Anchor tag HTML Presentation
Anchor tag HTML PresentationAnchor tag HTML Presentation
Anchor tag HTML Presentation
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html forms
Html formsHtml forms
Html forms
 
Html form tag
Html form tagHtml form tag
Html form tag
 
Css selectors
Css selectorsCss selectors
Css selectors
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Html forms
Html formsHtml forms
Html forms
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
html-css
html-csshtml-css
html-css
 
Html basics
Html basicsHtml basics
Html basics
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Basic html structure
Basic html structureBasic html structure
Basic html structure
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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