SlideShare a Scribd company logo
Table Structure
You need to know about four basic table tags, as
described next:
A table is a data structure that organizes information into rows and columns. It can be used to both
store and display data in a structured format. For example, databases store data in tables so that
information can be quickly accessed from specific rows.
Table Structure
<table>
</table>
The table tag is a container for every other tag used to create a table in
HTML. The opening and closing table tags should be placed at the
beginning
and end of your table.
<th>
</th>
The th tag stands for table header. An optional tag used instead of the td
tag,
this tag defines a cell containing header information. By default, the content
in
header cells is bolded and centered.
<tr>
</tr>
The tr tag stands for table row. The opening and closing tr tags surround the
cells for that row.
<td>
</td>
The td tag stands for table data and holds the actual content for the cell.
There
are opening and closing td tags for each cell in each row.
Attributes of a table
1. Align
2. Color
3. Border
4. Width
5. Height
6. padding
7. Pacing
With these tags in mind, you can create both basic and complex table structures
accordingto your needs. Say you want to create a basic table structure, such as the
following.
Popular Girls’
Names
Popular Boys’ Names
Emily Jacob
Sarah Michael
Your code might look like that shown next:
<table>
<tr>
<th>Popular Girls’ Names</th>
<th>Popular Boys’ Names</th>
</tr>
<tr>
<td>Emily</td>
<td>Jacob</td>
</tr>
<tr>
<td>Sarah</td>
<td>Michael</td>
</tr>
</table>
Opening and closing table tags surround the entire section of code. This tells the
browser that everything inside these tags belongs in the table. And there are
opening and closing tr tags for each row in the table. These surround td or th tags,
which, in turn, contain the actual content to be displayed by the browser.
Table with color
We can add background color to the table using the attribute "bgcolor".
This attribute can be added in "table"/"tr"/"td" tag. The color can be set on the
whole to table or to rows and column
Example Code:
<table border=1 bgcolor="green">
<tr>
<td>
This is first column
</td>
<td bgcolor="yellow">
This is second column
</td>
</tr>
</table>
CAPTION
<CAPTION> and </CAPTION> places a caption over your table. The caption will be bolded and
centered. Okay, it's a pretty dull caption. Use it if you'd like or feel free to forget it right here. I just
thought I'd show it to you. Heck, you're here aren't you?
Cellpadding and Cellspacing Attributes
There are two attributes called cellpadding and cellspacing which you will use to adjust the white
space in your table cells. The cellspacing attribute defines the width of the border, while cellpadding
represents the distance between cell borders and the content within a cell.
<html>
<head>
<title>HTML Table Cellpadding</title>
</head>
<body>
<table border="1" cellpadding="5" cellspacing=“10">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>
<tr>
<td>Ramesh Raman</td>
<td>5000</td>
</tr>
<tr>
<td>Shabbir Hussein</td>
<td>7000</td>
</tr>
</table>
</body>
</html>
Colspan and Rowspan Attributes
You will use colspan attribute if you want to merge two or more
columns into a single column. Similar way you will use rowspan if you
want to merge two or more rows.
Colspan and Rowspan Attributes
<html>
<head>
<title>HTML Table Colspan/Rowspan</title>
</head>
<body>
<table border="1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr><td rowspan="2">Row 1 Cell 1</td><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>
</body>
</html>
Here is an example of using image background
attribute.
<table border="1" bordercolor="green" background="cats and dogs.jpg">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr><td rowspan="2">Row 1 Cell 1</td>
<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>
Table Height and Width
You can set a table width and height using width and height attributes.
You can specify table width or height in terms of pixels or in terms of
percentage of available screen area
<table border="1" width="400" height="150">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
Table Header, Body, and Footer
Tables can be divided into three portions: a header, a body, and 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 holder of the table.
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.
A table may contain several <tbody> elements to indicate different pages or groups of data. But it is
notable that <thead> and <tfoot> tags should appear before <tbody>
example
<html>
<head>
<title>HTML Table</title>
</head>
<body>
<table border="1" width="100%">
<thead>
<tr>
<td colspan="4">This is the head of the table</td>
</tr>
</thead>
<tfoot>
Cont…
<tr>
<td colspan="4">This is the foot of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</tbody>
</table>
</body>
</html>
Adding CSS to tables
You can format your tables using Cascading Style Sheets (CSS). Using
CSS, you can specify background colors, border colors, border styles
etc.
Example
<table border="1" style="background-color:yellow;border:1px dotted
black;width:80%;border-collapse:collapse;">
<tr style="background-color:orange;color:white;">
<th style="padding:3px;">Table header</th><th style="padding:3px;">Table
header</th>
</tr>
<tr>
<td style="padding:3px;">Table cell 1</td><td style="padding:3px;">Table cell 2</td>
</tr>
<tr>
<td style="padding:3px;">Table cell 3</td><td style="padding:3px;">Table cell 4</td>
</tr>
</table>
Modifying table background color
<table width="20" border="1" cellspacing="0" cellpadding="0"
bgcolor="#99CCCC">
<tr>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
</tr>
<table width="20" border="1" cellspacing="0" cellpadding="">
<tr bgcolor="#FFCCCC">
<td>1</td>
<td>1</td>
</tr>
<tr bgcolor="#66CCFF">
<td>1</td>
<td>1</td>
</tr>
</table>
<table width="20" border="1" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FF99FF">0</td>
<td bgcolor="#FFCC99">0</td>
</tr>
<tr>
<td bgcolor="#FFFF33">0</td>
<td bgcolor="#663399">0</td>
</tr>
</table>
<TABLE border="1"
summary="This table gives some statistics about fruit
flies: average height and weight, and percentage
with red eyes (for both males and females).">
<CAPTION><EM>A test table with merged cells</EM></CAPTION>
<TR><TH rowspan="2"><TH colspan="2">Average
<TH rowspan="2">Red<BR>eyes
<TR><TH>height<TH>weight
<TR><TH>Males<TD>1.9<TD>0.003<TD>40%
<TR><TH>Females<TD>1.7<TD>0.002<TD>43%
</TABLE>
<TABLE border="1" cellpadding="5" cellspacing="2"
summary="History courses offered in the community of
Bath arranged by course name, tutor, summary,
code, and fee">
<TR>
<TH colspan="5" scope="colgroup">Community Courses -- Bath Autumn 2015</TH>
</TR>
<TR>
<TH scope="col" abbr="Name">Course Name</TH>
<TH scope="col" abbr="Tutor">Course Tutor</TH>
<TH scope="col">Summary</TH>
<TH scope="col">Code</TH>
<TH scope="col">Fee</TH>
</TR>
<TR>
<TD scope="row">After the Civil War</TD>
<TD>Dr. John Wroughton</TD>
<TD>
The course will examine the turbulent years in England
after 1646. <EM>6 weekly meetings starting Monday 13th
October.</EM>
</TD>
<TD>H27</TD>
<TD>&pound;32</TD>
</TR>
<TR>
<TD scope="row">An Introduction to Anglo-Saxon England</TD>
<TD>Mark Cottle</TD>
<TD>
One day course introducing the early medieval
period reconstruction the Anglo-Saxons and
their society. <EM>Saturday 18th October.</EM>
</TD>
<TD>H28</TD>
<TD>&pound;18</TD>
</TR>
<TR>
<TD scope="row">The Glory that was Greece</TD>
<TD>Valerie Lorenz</TD>
<TD>
Birthplace of democracy, philosophy, heartland of theater, home of
argument. The Romans may have done it but the Greeks did it
first. <EM>Saturday day school 25th October 1997</EM>
</TD>
<TD>H30</TD>
<TD>&pound;18</TD>
</TR>
</TABLE>
Inner Tables
a) How to create tables inside table columns?
b) How to control space between table cells?
Table inside table
Many a times we will be using table inside tables Now we will create two row with three columns.
The 2nd row, 2nd column will be split again to a table with two rows, two cols. Also we will be using
the attributes cellpadding and cellspacing to handle table space.
<table border=1 width=80% height=30% align=center cellpadding=1 cellspacing=1>
<tr height=30%>
<td>First Row</td>
<td>First Row</td>
<td>First Row</td>
</tr>
<tr height=70%>
<td>Second Row</td>
<td >
<table bgcolor=yellow border=1 width=80% height=80%>
<tr ><td> Inner Table </td>
<td> Inner Table </td>
</tr>
<tr >
<td> Inner Table </td>
<td> Inner Table </td></tr>
</table>
</td>
<td>Second Row</td>
</tr>
</table>
Table structure introduction

More Related Content

What's hot

Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
Marlon Jamera
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
Randy Connolly
 
html-table
html-tablehtml-table
html-table
Dhirendra Chauhan
 
Html tables
Html tablesHtml tables
Html tables
Sikandar Pandit
 
Html tables examples
Html tables   examplesHtml tables   examples
Html tables examples
Mukesh Tekwani
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in htmlCK Yang
 
HTML Table Tags
HTML Table TagsHTML Table Tags
HTML Table Tags
Kainat Ilyas
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
Steve Guinan
 
Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3
Mudasir Syed
 
HTML Tables in Omeka
HTML Tables in OmekaHTML Tables in Omeka
HTML Tables in Omeka
American Antiquarian Society
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTMLAarti P
 
Frames tables forms
Frames tables formsFrames tables forms
Frames tables forms
nobel mujuji
 
Html web designing using tables
Html web designing using tablesHtml web designing using tables
Html web designing using tables
Jesus Obenita Jr.
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTMLDoncho Minkov
 
Html
HtmlHtml
Lect# 1 html part ii
Lect# 1 html part iiLect# 1 html part ii
Lect# 1 html part ii
MuhammadAbdulSattarC
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)club23
 
HTML basic
HTML basicHTML basic
HTML basic
Yoeung Vibol
 

What's hot (19)

Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
html-table
html-tablehtml-table
html-table
 
Html tables
Html tablesHtml tables
Html tables
 
Html tables examples
Html tables   examplesHtml tables   examples
Html tables examples
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
 
HTML Table Tags
HTML Table TagsHTML Table Tags
HTML Table Tags
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
 
Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3
 
HTML Tables in Omeka
HTML Tables in OmekaHTML Tables in Omeka
HTML Tables in Omeka
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
 
Frames tables forms
Frames tables formsFrames tables forms
Frames tables forms
 
Html web designing using tables
Html web designing using tablesHtml web designing using tables
Html web designing using tables
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Html
HtmlHtml
Html
 
Lect# 1 html part ii
Lect# 1 html part iiLect# 1 html part ii
Lect# 1 html part ii
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
 
HTML basic
HTML basicHTML basic
HTML basic
 

Similar to Table structure introduction

v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptx
HemantBansal35
 
Tables
TablesTables
Tables
savitamhaske
 
Lecture-4.pptx
Lecture-4.pptxLecture-4.pptx
Lecture-4.pptx
vishal choudhary
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
MLikithMahendra
 
Computer language - Html tables
Computer language - Html tablesComputer language - Html tables
Computer language - Html tables
Dr. I. Uma Maheswari Maheswari
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
AhmedAlmughalis1
 
Html tables
Html tablesHtml tables
Html tables
Himanshu Pathak
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
ShararehShojaei1
 
HTML
HTMLHTML
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
Yaowaluck Promdee
 
Working With Tables in HTML
Working With Tables in HTMLWorking With Tables in HTML
Working With Tables in HTML
Shehzad Yaqoob
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
AliMUSSA3
 
Table in MS Frontpage 2003
Table in MS Frontpage 2003Table in MS Frontpage 2003
Table in MS Frontpage 2003Ann Alcid
 
Lecture 2.ppt
Lecture 2.pptLecture 2.ppt
Lecture 2.ppt
MuhammadRehan856177
 
HTML Lecture Part 2 of 2
HTML Lecture Part 2 of 2HTML Lecture Part 2 of 2
HTML Lecture Part 2 of 2
Sharon Wasden
 
Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)
Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)
Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)
Nuzhat Memon
 
Html basics 7 table
Html basics 7 tableHtml basics 7 table
Html basics 7 tableH K
 
Response Tables.ppt
Response Tables.pptResponse Tables.ppt
Response Tables.ppt
Muhammad Rehan
 
2. HTML Tables.ppt
2. HTML Tables.ppt2. HTML Tables.ppt
2. HTML Tables.ppt
MuhammadRehan856177
 

Similar to Table structure introduction (20)

v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptx
 
Handout5 tables
Handout5 tablesHandout5 tables
Handout5 tables
 
Tables
TablesTables
Tables
 
Lecture-4.pptx
Lecture-4.pptxLecture-4.pptx
Lecture-4.pptx
 
WEP4 and 5.pptx
WEP4 and 5.pptxWEP4 and 5.pptx
WEP4 and 5.pptx
 
Computer language - Html tables
Computer language - Html tablesComputer language - Html tables
Computer language - Html tables
 
01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
Html tables
Html tablesHtml tables
Html tables
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
 
HTML
HTMLHTML
HTML
 
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
 
Working With Tables in HTML
Working With Tables in HTMLWorking With Tables in HTML
Working With Tables in HTML
 
Lecture 5 html table
Lecture 5 html tableLecture 5 html table
Lecture 5 html table
 
Table in MS Frontpage 2003
Table in MS Frontpage 2003Table in MS Frontpage 2003
Table in MS Frontpage 2003
 
Lecture 2.ppt
Lecture 2.pptLecture 2.ppt
Lecture 2.ppt
 
HTML Lecture Part 2 of 2
HTML Lecture Part 2 of 2HTML Lecture Part 2 of 2
HTML Lecture Part 2 of 2
 
Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)
Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)
Std 10 Computer Chapter 4 List and Table Handling in HTML (Part 2 Table in HTML)
 
Html basics 7 table
Html basics 7 tableHtml basics 7 table
Html basics 7 table
 
Response Tables.ppt
Response Tables.pptResponse Tables.ppt
Response Tables.ppt
 
2. HTML Tables.ppt
2. HTML Tables.ppt2. HTML Tables.ppt
2. HTML Tables.ppt
 

More from nobel mujuji

Positioning text
Positioning textPositioning text
Positioning text
nobel mujuji
 
Inserting imagesin html
Inserting imagesin htmlInserting imagesin html
Inserting imagesin html
nobel mujuji
 
Html images and html backgrounds
Html images and html backgroundsHtml images and html backgrounds
Html images and html backgrounds
nobel mujuji
 
Html hyperlinks
Html hyperlinksHtml hyperlinks
Html hyperlinks
nobel mujuji
 
Html frames
Html framesHtml frames
Html frames
nobel mujuji
 
Html forms
Html formsHtml forms
Html forms
nobel mujuji
 
Html character entities
Html character entitiesHtml character entities
Html character entities
nobel mujuji
 
Horizontal lines!
Horizontal lines!Horizontal lines!
Horizontal lines!
nobel mujuji
 
Creating lists
Creating listsCreating lists
Creating lists
nobel mujuji
 
Chapter 2 introduction to html5
Chapter 2 introduction to html5Chapter 2 introduction to html5
Chapter 2 introduction to html5
nobel mujuji
 
Chapter 1 one html
Chapter 1 one htmlChapter 1 one html
Chapter 1 one html
nobel mujuji
 
Chapter 1 html
Chapter 1 htmlChapter 1 html
Chapter 1 html
nobel mujuji
 
Adding text in html
Adding text in htmlAdding text in html
Adding text in html
nobel mujuji
 
Javascript conditional statements
Javascript conditional statementsJavascript conditional statements
Javascript conditional statements
nobel mujuji
 

More from nobel mujuji (14)

Positioning text
Positioning textPositioning text
Positioning text
 
Inserting imagesin html
Inserting imagesin htmlInserting imagesin html
Inserting imagesin html
 
Html images and html backgrounds
Html images and html backgroundsHtml images and html backgrounds
Html images and html backgrounds
 
Html hyperlinks
Html hyperlinksHtml hyperlinks
Html hyperlinks
 
Html frames
Html framesHtml frames
Html frames
 
Html forms
Html formsHtml forms
Html forms
 
Html character entities
Html character entitiesHtml character entities
Html character entities
 
Horizontal lines!
Horizontal lines!Horizontal lines!
Horizontal lines!
 
Creating lists
Creating listsCreating lists
Creating lists
 
Chapter 2 introduction to html5
Chapter 2 introduction to html5Chapter 2 introduction to html5
Chapter 2 introduction to html5
 
Chapter 1 one html
Chapter 1 one htmlChapter 1 one html
Chapter 1 one html
 
Chapter 1 html
Chapter 1 htmlChapter 1 html
Chapter 1 html
 
Adding text in html
Adding text in htmlAdding text in html
Adding text in html
 
Javascript conditional statements
Javascript conditional statementsJavascript conditional statements
Javascript conditional statements
 

Recently uploaded

Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape ReportSOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
yhkoc
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
Tiktokethiodaily
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
pchutichetpong
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Subhajit Sahu
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
vcaxypu
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 

Recently uploaded (20)

Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape ReportSOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape Report
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 

Table structure introduction

  • 1. Table Structure You need to know about four basic table tags, as described next:
  • 2. A table is a data structure that organizes information into rows and columns. It can be used to both store and display data in a structured format. For example, databases store data in tables so that information can be quickly accessed from specific rows.
  • 3. Table Structure <table> </table> The table tag is a container for every other tag used to create a table in HTML. The opening and closing table tags should be placed at the beginning and end of your table. <th> </th> The th tag stands for table header. An optional tag used instead of the td tag, this tag defines a cell containing header information. By default, the content in header cells is bolded and centered. <tr> </tr> The tr tag stands for table row. The opening and closing tr tags surround the cells for that row. <td> </td> The td tag stands for table data and holds the actual content for the cell. There are opening and closing td tags for each cell in each row.
  • 4. Attributes of a table 1. Align 2. Color 3. Border 4. Width 5. Height 6. padding 7. Pacing
  • 5. With these tags in mind, you can create both basic and complex table structures accordingto your needs. Say you want to create a basic table structure, such as the following. Popular Girls’ Names Popular Boys’ Names Emily Jacob Sarah Michael
  • 6. Your code might look like that shown next: <table> <tr> <th>Popular Girls’ Names</th> <th>Popular Boys’ Names</th> </tr> <tr> <td>Emily</td> <td>Jacob</td> </tr> <tr> <td>Sarah</td> <td>Michael</td> </tr> </table>
  • 7. Opening and closing table tags surround the entire section of code. This tells the browser that everything inside these tags belongs in the table. And there are opening and closing tr tags for each row in the table. These surround td or th tags, which, in turn, contain the actual content to be displayed by the browser. Table with color We can add background color to the table using the attribute "bgcolor". This attribute can be added in "table"/"tr"/"td" tag. The color can be set on the whole to table or to rows and column
  • 8. Example Code: <table border=1 bgcolor="green"> <tr> <td> This is first column </td> <td bgcolor="yellow"> This is second column </td> </tr> </table>
  • 9. CAPTION <CAPTION> and </CAPTION> places a caption over your table. The caption will be bolded and centered. Okay, it's a pretty dull caption. Use it if you'd like or feel free to forget it right here. I just thought I'd show it to you. Heck, you're here aren't you?
  • 10. Cellpadding and Cellspacing Attributes There are two attributes called cellpadding and cellspacing which you will use to adjust the white space in your table cells. The cellspacing attribute defines the width of the border, while cellpadding represents the distance between cell borders and the content within a cell.
  • 11. <html> <head> <title>HTML Table Cellpadding</title> </head> <body> <table border="1" cellpadding="5" cellspacing=“10"> <tr> <th>Name</th> <th>Salary</th> </tr> <tr> <td>Ramesh Raman</td> <td>5000</td> </tr> <tr> <td>Shabbir Hussein</td> <td>7000</td> </tr> </table> </body> </html>
  • 12. Colspan and Rowspan Attributes You will use colspan attribute if you want to merge two or more columns into a single column. Similar way you will use rowspan if you want to merge two or more rows.
  • 13. Colspan and Rowspan Attributes <html> <head> <title>HTML Table Colspan/Rowspan</title> </head> <body> <table border="1"> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> </tr> <tr><td rowspan="2">Row 1 Cell 1</td><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> </body> </html>
  • 14. Here is an example of using image background attribute. <table border="1" bordercolor="green" background="cats and dogs.jpg"> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> </tr> <tr><td rowspan="2">Row 1 Cell 1</td> <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>
  • 15. Table Height and Width You can set a table width and height using width and height attributes. You can specify table width or height in terms of pixels or in terms of percentage of available screen area
  • 16. <table border="1" width="400" height="150"> <tr> <td>Row 1, Column 1</td> <td>Row 1, Column 2</td> </tr> <tr> <td>Row 2, Column 1</td> <td>Row 2, Column 2</td> </tr> </table>
  • 17. Table Header, Body, and Footer Tables can be divided into three portions: a header, a body, and 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 holder of the table. 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. A table may contain several <tbody> elements to indicate different pages or groups of data. But it is notable that <thead> and <tfoot> tags should appear before <tbody>
  • 18. example <html> <head> <title>HTML Table</title> </head> <body> <table border="1" width="100%"> <thead> <tr> <td colspan="4">This is the head of the table</td> </tr> </thead> <tfoot>
  • 19. Cont… <tr> <td colspan="4">This is the foot of the table</td> </tr> </tfoot> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> </body> </html>
  • 20. Adding CSS to tables You can format your tables using Cascading Style Sheets (CSS). Using CSS, you can specify background colors, border colors, border styles etc.
  • 21. Example <table border="1" style="background-color:yellow;border:1px dotted black;width:80%;border-collapse:collapse;"> <tr style="background-color:orange;color:white;"> <th style="padding:3px;">Table header</th><th style="padding:3px;">Table header</th> </tr> <tr> <td style="padding:3px;">Table cell 1</td><td style="padding:3px;">Table cell 2</td> </tr> <tr> <td style="padding:3px;">Table cell 3</td><td style="padding:3px;">Table cell 4</td> </tr> </table>
  • 22. Modifying table background color <table width="20" border="1" cellspacing="0" cellpadding="0" bgcolor="#99CCCC"> <tr> <td>0</td> <td>0</td> </tr> <tr> <td>0</td> <td>0</td> </tr>
  • 23. <table width="20" border="1" cellspacing="0" cellpadding=""> <tr bgcolor="#FFCCCC"> <td>1</td> <td>1</td> </tr> <tr bgcolor="#66CCFF"> <td>1</td> <td>1</td> </tr> </table>
  • 24. <table width="20" border="1" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FF99FF">0</td> <td bgcolor="#FFCC99">0</td> </tr> <tr> <td bgcolor="#FFFF33">0</td> <td bgcolor="#663399">0</td> </tr> </table>
  • 25. <TABLE border="1" summary="This table gives some statistics about fruit flies: average height and weight, and percentage with red eyes (for both males and females)."> <CAPTION><EM>A test table with merged cells</EM></CAPTION> <TR><TH rowspan="2"><TH colspan="2">Average <TH rowspan="2">Red<BR>eyes <TR><TH>height<TH>weight <TR><TH>Males<TD>1.9<TD>0.003<TD>40% <TR><TH>Females<TD>1.7<TD>0.002<TD>43% </TABLE>
  • 26. <TABLE border="1" cellpadding="5" cellspacing="2" summary="History courses offered in the community of Bath arranged by course name, tutor, summary, code, and fee"> <TR> <TH colspan="5" scope="colgroup">Community Courses -- Bath Autumn 2015</TH> </TR> <TR> <TH scope="col" abbr="Name">Course Name</TH> <TH scope="col" abbr="Tutor">Course Tutor</TH> <TH scope="col">Summary</TH> <TH scope="col">Code</TH> <TH scope="col">Fee</TH> </TR>
  • 27. <TR> <TD scope="row">After the Civil War</TD> <TD>Dr. John Wroughton</TD> <TD> The course will examine the turbulent years in England after 1646. <EM>6 weekly meetings starting Monday 13th October.</EM> </TD> <TD>H27</TD> <TD>&pound;32</TD> </TR> <TR> <TD scope="row">An Introduction to Anglo-Saxon England</TD> <TD>Mark Cottle</TD> <TD> One day course introducing the early medieval period reconstruction the Anglo-Saxons and their society. <EM>Saturday 18th October.</EM> </TD> <TD>H28</TD> <TD>&pound;18</TD> </TR>
  • 28. <TR> <TD scope="row">The Glory that was Greece</TD> <TD>Valerie Lorenz</TD> <TD> Birthplace of democracy, philosophy, heartland of theater, home of argument. The Romans may have done it but the Greeks did it first. <EM>Saturday day school 25th October 1997</EM> </TD> <TD>H30</TD> <TD>&pound;18</TD> </TR> </TABLE>
  • 29. Inner Tables a) How to create tables inside table columns? b) How to control space between table cells?
  • 30. Table inside table Many a times we will be using table inside tables Now we will create two row with three columns. The 2nd row, 2nd column will be split again to a table with two rows, two cols. Also we will be using the attributes cellpadding and cellspacing to handle table space.
  • 31. <table border=1 width=80% height=30% align=center cellpadding=1 cellspacing=1> <tr height=30%> <td>First Row</td> <td>First Row</td> <td>First Row</td> </tr> <tr height=70%> <td>Second Row</td> <td > <table bgcolor=yellow border=1 width=80% height=80%> <tr ><td> Inner Table </td> <td> Inner Table </td> </tr>
  • 32. <tr > <td> Inner Table </td> <td> Inner Table </td></tr> </table> </td> <td>Second Row</td> </tr> </table>