Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

HTML Tutorial
HTML Introduction
HTML Elements
HTML Basic Tags
HTML Formatting
HTML Entities
HTML Links
HTML Frames
HTML Tables
HTML Lists
HTML Forms
HTML Images
HTML Background
HTML Colors
HTML Colorvalues
HTML Colornames
HTML Quick List
HTML Layout
HTML Fonts
HTML 4.0 Why
HTML Styles
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML Attributes
HTML Events
HTML URL-encode
HTML Webserver
HTML Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


HTML Tables
Previous Next

  • The HTML table model allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other tables, etc. -- into rows and columns of cells.


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).
  • The letters td stands for "table data," which is the content of a data cell.
  • A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc.
<table border="1">
    <tr>
         <td>row 1, cell 1</td>
         <td>row 1, cell 2</td>
    </tr>
    <tr>
         <td>row 2, cell 1</td>
         <td>row 2, cell 2p</td>
    </tr>
</table>



Headings in a Table
Headings in a table are defined with the <th> tag.
<table border="1">
    <tr>
         <th>Heading</th>
         <th>Another Heading</th>
    </tr>
    <tr>
         <td>row 1, cell 1</td>
         <td>row 1, cell 2</td>
    </tr>
    <tr>
         <td>row 2, cell 1</td>
         <td>row 2, cell 2p</td>
    </tr>
</table>



Tables and the Border Attribute
The table will be displayed without any borders if you do not specify a border attribute . Sometimes this can be useful, but most of the time, you want to show the borders.
To display a table with borders, you will have to use the border attribute:
<table border="1">
    <tr>
         <td>row 1, cell 1</td>
         <td>row 1, cell 2</td>
    </tr>
</table>



Spanning Multiple Rows and Cells
Use rowspan to span multiple rows & colspan to span multiple columns.
To display a table with borders, you will have to use the border attribute:
<table border="1">
    <tr>
         <td>column1</td>
         <td>column2</td>
         <td>column3</td>
    </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>
O/P:
column1 column2 column3
row 1, cell 1 row 1, cell 2 row 1, cell 3
row 2, cell 2 row 2, cell 3
row 3, cell 1



Cell Padding and Spacing
You will be able to adjust the white space on your tables with the cellpadding and cellspacing attributes .
Padding represents the distance between cell borders and the content within, while spacing defines the width of the border.
<table border="1">
    <tr>
         <td >row 1, cell 1</td>
         <td>row 1, cell 2</td>
    </tr>
    <tr>
         <td>row 2, cell 1</td>
         <td>row 2, cell 2</td>
    </tr>
</table>
O/P: Table without Cell Padding and Spacing
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
<table border="1" cellspacing="10">
    <tr>
         <td >row 1, cell 1</td>
         <td>row 1, cell 2</td>
    </tr>
    <tr>
         <td>row 2, cell 1</td>
         <td>row 2, cell 2</td>
    </tr>
</table>
O/P: Table with Cellspacing
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
<table border="1" cellpadding="10">
    <tr>
         <td >row 1, cell 1</td>
         <td>row 1, cell 2</td>
    </tr>
    <tr>
         <td>row 2, cell 1</td>
         <td>row 2, cell 2</td>
    </tr>
</table>
O/P: Table with Cellpadding
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2


Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords:creating html tables, html font color code tables, html help tables, advanced html tables, html tutorial tables


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.