Each table cell is defined by a
and a | tag. td stands for table data. Everything between
and | are the content of ...
Tutorials
References
Exercises
Videos
Menu
Login
GetCertified
WebsiteNEW
ProNEW
HTML
CSS
JAVASCRIPT
SQL
PYTHON
PHP
BOOTSTRAP
HOWTO
W3.CSS
JAVA
JQUERY
C
C++
C#
R
React
Darkmode
Darkcode
×
Tutorials
HTMLandCSS
LearnHTML
LearnCSS
LearnRWD
LearnBootstrap
LearnW3.CSS
LearnColors
LearnIcons
LearnGraphics
LearnSVG
LearnCanvas
LearnHowTo
LearnSass
DataAnalytics
LearnAI
LearnMachineLearning
LearnDataScience
LearnNumPy
LearnPandas
LearnSciPy
LearnMatplotlib
LearnStatistics
LearnExcel
XMLTutorials
LearnXML
LearnXMLAJAX
LearnXMLDOM
LearnXMLDTD
LearnXMLSchema
LearnXSLT
LearnXPath
LearnXQuery
JavaScript
LearnJavaScript
LearnjQuery
LearnReact
LearnAngularJS
LearnJSON
LearnAJAX
LearnAppML
LearnW3.JS
Programming
LearnPython
LearnJava
LearnC
LearnC++
LearnC#
LearnR
LearnKotlin
LearnGo
LearnDjango
LearnTypeScript
ServerSide
LearnSQL
LearnMySQL
LearnPHP
LearnASP
LearnNode.js
LearnRaspberryPi
LearnGit
LearnAWSCloud
WebBuilding
CreateaWebsiteNEW
WhereToStart
WebTemplates
WebStatistics
WebCertificates
WebDevelopment
CodeEditor
TestYourTypingSpeed
PlayaCodeGame
CyberSecurity
Accessibility
DataAnalytics
LearnAI
LearnMachineLearning
LearnDataScience
LearnNumPy
LearnPandas
LearnSciPy
LearnMatplotlib
LearnStatistics
LearnExcel
LearnGoogleSheets
XMLTutorials
LearnXML
LearnXMLAJAX
LearnXMLDOM
LearnXMLDTD
LearnXMLSchema
LearnXSLT
LearnXPath
LearnXQuery
×
References
HTML
HTMLTagReference
HTMLBrowserSupport
HTMLEventReference
HTMLColorReference
HTMLAttributeReference
HTMLCanvasReference
HTMLSVGReference
GoogleMapsReference
CSS
CSSReference
CSSBrowserSupport
CSSSelectorReference
Bootstrap3Reference
Bootstrap4Reference
W3.CSSReference
IconReference
SassReference
JavaScript
JavaScriptReference
HTMLDOMReference
jQueryReference
AngularJSReference
AppMLReference
W3.JSReference
Programming
PythonReference
JavaReference
ServerSide
SQLReference
MySQLReference
PHPReference
ASPReference
XML
XMLDOMReference
XMLHttpReference
XSLTReference
XMLSchemaReference
CharacterSets
HTMLCharacterSets
HTMLASCII
HTMLANSI
HTMLWindows-1252
HTMLISO-8859-1
HTMLSymbols
HTMLUTF-8
×
ExercisesandQuizzes
Exercises
HTMLExercises
CSSExercises
JavaScriptExercises
SQLExercises
MySQLExercises
PHPExercises
PythonExercises
NumPyExercises
PandasExercises
SciPyExercises
jQueryExercises
JavaExercises
C++Exercises
C#Exercises
RExercises
KotlinExercises
GoExercises
BootstrapExercises
Bootstrap4Exercises
Bootstrap5Exercises
GitExercises
Quizzes
HTMLQuiz
CSSQuiz
JavaScriptQuiz
SQLQuiz
MySQLQuiz
PHPQuiz
PythonQuiz
NumPyQuiz
PandasQuiz
SciPyQuiz
jQueryQuiz
JavaQuiz
C++Quiz
C#Quiz
RQuiz
KotlinQuiz
XMLQuiz
BootstrapQuiz
Bootstrap4Quiz
Bootstrap5Quiz
CyberSecurityQuiz
AccessibilityQuiz
Courses
HTMLCourse
CSSCourse
JavaScriptCourse
FrontEndCourse
SQLCourse
PHPCourse
PythonCourse
NumPyCourse
PandasCourse
DataAnalyticsCourse
jQueryCourse
JavaCourse
C++Course
C#Course
RCourse
XMLCourse
CyberSecurityCourse
AccessibilityCourse
Certificates
HTMLCertificate
CSSCertificate
JavaScriptCertificate
FrontEndCertificate
SQLCertificate
PHPCertificate
PythonCertificate
DataScienceCertificate
Bootstrap3Certificate
Bootstrap4Certificate
jQueryCertificate
JavaCertificate
C++Certificate
ReactCertificate
XMLCertificate
×
Tutorials
References
Exercises
PaidCourses
Spaces
Videos
Shop
Pro
HTMLTutorial
HTMLHOME
HTMLIntroduction
HTMLEditors
HTMLBasic
HTMLElements
HTMLAttributes
HTMLHeadings
HTMLParagraphs
HTMLStyles
HTMLFormatting
HTMLQuotations
HTMLComments
HTMLColors
Colors
RGB
HEX
HSL
HTMLCSS
HTMLLinks
Links
LinkColors
LinkBookmarks
HTMLImages
Images
ImageMap
BackgroundImages
ThePictureElement
HTMLFavicon
HTMLTables
HTMLTables
TableBorders
TableSizes
TableHeaders
Padding&Spacing
Colspan&Rowspan
TableStyling
TableColgroup
HTMLLists
Lists
UnorderedLists
OrderedLists
OtherLists
HTMLBlock&Inline
HTMLClasses
HTMLId
HTMLIframes
HTMLJavaScript
HTMLFilePaths
HTMLHead
HTMLLayout
HTMLResponsive
HTMLComputercode
HTMLSemantics
HTMLStyleGuide
HTMLEntities
HTMLSymbols
HTMLEmojis
HTMLCharset
HTMLURLEncode
HTMLvs.XHTML
HTMLForms
HTMLForms
HTMLFormAttributes
HTMLFormElements
HTMLInputTypes
HTMLInputAttributes
HTMLInputFormAttributes
HTMLGraphics
HTMLCanvas
HTMLSVG
HTMLMedia
HTMLMedia
HTMLVideo
HTMLAudio
HTMLPlug-ins
HTMLYouTube
HTMLAPIs
HTMLGeolocation
HTMLDrag/Drop
HTMLWebStorage
HTMLWebWorkers
HTMLSSE
HTMLExamples
HTMLExamples
HTMLQuiz
HTMLExercises
HTMLCertificate
HTMLSummary
HTMLAccessibility
HTMLReferences
HTMLTagList
HTMLAttributes
HTMLGlobalAttributes
HTMLBrowserSupport
HTMLEvents
HTMLColors
HTMLCanvas
HTMLAudio/Video
HTMLDoctypes
HTMLCharacterSets
HTMLURLEncode
HTMLLangCodes
HTTPMessages
HTTPMethods
PXtoEMConverter
KeyboardShortcuts
HTMLTables
❮Previous
Next❯
HTMLtablesallowwebdeveloperstoarrangedataintorowsand
columns.
Example
Company
Contact
Country
AlfredsFutterkiste
MariaAnders
Germany
CentrocomercialMoctezuma
FranciscoChang
Mexico
ErnstHandel
RolandMendel
Austria
IslandTrading
HelenBennett
UK
LaughingBacchusWinecellars
YoshiTannamuri
Canada
MagazziniAlimentariRiuniti
GiovanniRovelli
Italy
TryitYourself»
DefineanHTMLTable
AtableinHTMLconsistsoftablecellsinsiderowsandcolumns
Example
AsimpleHTMLtable:
Company |
Contact | Country |
AlfredsFutterkiste |
Maria
Anders | Germany |
Centro
comercialMoctezuma |
Francisco
Chang | Mexico |
TryitYourself»
TableCells
Eachtablecellisdefinedbya
anda | tag.
td
standsfortabledata.
Everythingbetween
and | arethecontentofthetablecell.
Example
TryitYourself»
Note:tabledataelementsarethedatacontainersofthetable.Theycancontain
allsortsofHTMLelements;text,images,lists,othertables,etc.
TableRows
Eachtablerowstartswitha
andendwitha
tag.
tr
standsfortablerow.
Example
Emil |
Tobias | Linus |
16 |
14 | 10 |
TryitYourself»
Youcanhaveasmanyrowsasyoulikeinatable,justmakesurethatthenumberofcellsarethesameineachrow.
Note:Therearetimeswherearowcanhavelessormorecellsthananother.Youwilllearnaboutthatinalaterchapter.
TableHeaders
Sometimesyouwantyourcellstobeheaders,inthosecasesusethe
taginsteadofthe
|
tag:
Example
Letthefirstrowbetableheaders:
Person1 |
Person2 | Person
3 |
Emil |
Tobias | Linus |
16 |
14 | 10 |
TryitYourself»
Bydefault,thetextin |
elements
areboldandcentered,butyoucanchangethatwithCSS.
HTMLExercises
TestYourselfWithExercises
Exercise:
Addatablerowwithtwotableheaders.
Thetwotableheadersshouldhavethevalue"Name"and"Age".
SubmitAnswer»
StarttheExercise
HTMLTableTags
Tag
Description
Definesatable
Definesaheadercellinatable
|
Definesarowinatable
Definesacellinatable
Definesatablecaption
Specifiesagroupofoneormorecolumnsinatableforformatting
Specifiescolumnpropertiesforeachcolumnwithina
element
Groupstheheadercontentinatable
|
Groupsthebodycontentinatable
Groupsthefootercontentinatable
ForacompletelistofallavailableHTMLtags,visitourHTMLTagReference.
❮Previous
Next❯
LEARNMORE
StylingTables
FilterTable
SortTable
ResponsiveTable
ZebraStripedTable
NEW
WejustlaunchedW3Schoolsvideos
Explorenow
COLORPICKER
Getcertifiedbycompletingacoursetoday!
w3schoolsCERTIFIED.2022
Getstarted
CODEGAME
PlayGame
|