Sunteți pe pagina 1din 3

8/2/13

HTML Tables
Search w3schools.com: Select Language

HOME

HTML

C SS

JAVASC RIPT

JQUERY

XML

ASP.NET

PHP

SQL

MORE...

R EFER ENC ES

EXAMPLES

FO R UM

ABO UT

New Upcoming Projects


www.99acres.com/New_Projects 1/2/3/4 BHK Flats/Apts in ur Budget Search by Locality,Price,Amenities.

SHARE THIS PAGE

Like

76k

HTML Basic
HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Formatting HTML Links HTML Head HTML CSS HTML Images HTML Tables HTML Lists HTML Blocks HTML Layout HTML Forms HTML Iframes HTML Colors HTML Colornames HTML Colorvalues HTML JavaScript HTML Entities HTML URL Encode HTML Quick List HTML Summary HTML XHTML

HTML Tables
Previous Next Chapter

WEB HOSTING
Best Web Hosting eUK Web Hosting UK Reseller Hosting Domain, Hosting & Email

HTML Table Example:


First Name Last Name Points Jill Eve John Adam Smith Jackson Doe Johnson 50 94 80 67

WEB BUILDING
Download XML Editor FREE Website BUILDER FREE Website C reator Best Website Templates

Try it Yourself - Examples


Tables How to create tables in an HTML document. (You can find more examples at the bottom of this page).

STATISTICS
Browser Statistics OS Statistics Display Statistics

HTML Tables
Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). td stands for "table data," and holds the content of a data cell. A <td> tag can contain text, links, images, lists, forms, other tables, etc.

Table Example
< t a b l eb o r d e r = " 1 " > < t r > < t d > r o w1 ,c e l l1 < / t d > < t d > r o w1 ,c e l l2 < / t d > < / t r > < t r > < t d > r o w2 ,c e l l1 < / t d > < t d > r o w2 ,c e l l2 < / t d > < / t r > < / t a b l e >
How the HTML code above looks in a browser: row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2

HTML5 News
HTML5 Intro HTML5 New Elements HTML5 Canvas HTML5 SVG HTML5 Drag/Drop HTML5 Geolocation HTML5 Video HTML5 Audio HTML5 Input Types HTML5 Form Elements HTML5 Form Attributes HTML5 Semantic HTML5 Web Storage HTML5 App Cache HTML5 Web Workers HTML5 SSE

HTML Tables and the Border Attribute


If you do not specify a border attribute, the table will be displayed without borders. Sometimes this can be useful, but most of the time, we want the borders to show. To display a table with borders, specify the border attribute:

HTML Media
HTML Media HTML Object HTML Audio HTML Video HTML YouTube

< t a b l eb o r d e r = " 1 " > < t r > < t d > R o w1 ,c e l l1 < / t d > < t d > R o w1 ,c e l l2 < / t d > < / t r > < / t a b l e >

HTML Examples
HTML Examples HTML Quiz HTML5 Quiz HTML Certificate HTML5 Certificate

HTML Table Headers


Header information in a table are defined with the <th> tag. All major browsers display the text in the <th> element as bold and centered.

HTML References
HTML Tag List HTML Attributes

< t a b l eb o r d e r = " 1 " > < t r > < t h > H e a d e r1 < / t h > < t h > H e a d e r2 < / t h > < / t r > < t r > < t d > r o w1 ,c e l l1 < / t d >

w3schools.com/html/html_tables.asp

1/3

8/2/13
HTML Events HTML Canvas HTML Audio/Video HTML Doctypes HTML Colornames HTML Colorpicker HTML Colormixer HTML Character Sets HTML ASCII HTML ISO-8859-1 HTML Symbols HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods Keyboard Shortcuts Tables without borders How to create tables without borders. Table headers How to create table headers. Table with a caption How to add a caption to a table.

HTML Tables
< t d > r o w1 ,c e l l2 < / t d > < / t r > < t r > < t d > r o w2 ,c e l l1 < / t d > < t d > r o w2 ,c e l l2 < / t d > < / t r > < / t a b l e >
How the HTML code above looks in your browser: Header 1 Header 2

row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2

More Examples

Table cells that span more than one row/column How to define table cells that span more than one row or one column. Tags inside a table How to display elements inside other elements. Cell padding How to use cellpadding to create more white space between the cell content and its borders. Cell spacing How to use cellspacing to increase the distance between the cells.

HTML Table Tags


Tag <table> <th> <tr> <td> <caption> <colgroup> <col> <thead> <tbody> <tfoot> Description Defines a table Defines a header cell in a table Defines a row in a table Defines a cell in a table Defines a table caption Specifies a group of one or more columns in a table for formatting Specifies column properties for each column within a <colgroup> element Groups the header content in a table Groups the body content in a table Groups the footer content in a table

Previous

Next Chapter

W3Schools' Online Certification


The perfect solution for professionals who need to balance work, family, and career building. More than 10 000 certificates already issued!

Get Your Certificate


The HTML Certificate documents your knowledge of HTML. The HTML5 Certificate documents your knowledge of advanced HTML5.

w3schools.com/html/html_tables.asp

2/3

8/2/13

HTML Tables
The CSS Certificate documents your knowledge of advanced CSS. The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM. The jQuery Certificate documents your knowledge of jQuery. The XML Certificate documents your knowledge of XML, XML DOM and XSLT. The ASP Certificate documents your knowledge of ASP, SQL, and ADO. The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

Top 10 Tutorials
HTML Tutorial HTML5 Tutorial C SS Tutorial C SS3 Tutorial JavaScript Tutorial jQuery Tutorial SQL Tutorial PHP Tutorial ASP.NET Tutorial XML Tutorial

Top 10 References
HTML/HTML5 Reference C SS 1,2,3 Reference C SS 3 Browser Support JavaScript HTML DOM XML DOM PHP Reference jQuery Reference ASP.NET Reference HTML C olors

Examples
HTML Examples C SS Examples XML Examples JavaScript Examples HTML DOM Examples XML DOM Examples AJAX Examples ASP.NET Examples Razor Examples ASP Examples SVG Examples

Quizzes
HTML Quiz HTML5 Quiz XHTML Quiz C SS Quiz JavaScript Quiz jQuery Quiz XML Quiz ASP Quiz PHP Quiz SQL Quiz

Color Picker

Statistics
Browser Statistics Browser OS Browser Display

RE P O RT E RRO R

HO ME

TO P

P RI N T

FO RU M

A BO U T

A D V E RT I SE WI T H U S

W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use and privacy policy. C opyright 1999-2013 by Refsnes Data. All Rights Reserved.

w3schools.com/html/html_tables.asp

3/3

S-ar putea să vă placă și