Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, HTML Tables in HTML / XHTML; HTML Tables Tables Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=5563


Reply
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
28-10-2008, 06:57 PM
 
HTML Tables


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.
HTML Code:
<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>
How it looks in a browser:
row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2
Tables and the Border Attribute

If you do not specify a border attribute the table will be displayed without any borders. Sometimes this can be useful, but most of the time, you want the borders to show.
To display a table with borders, you will have to use the border attribute:
HTML Code:
<table border="1">
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
Headings in a Table

Headings in a table are defined with the <th> tag.
HTML Code:
<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 2</td>
</tr>
</table>
How it looks in a browser:
Heading Another Heading row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2
Empty Cells in a Table

Table cells with no content are not displayed very well in most browsers.
HTML Code:
<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></td>
</tr>
</table>
How it looks in a browser:
row 1, cell 1 row 1, cell 2 row 2, cell 1
Note that the borders around the empty table cell are missing (NB! Mozilla Firefox displays the border).
To avoid this, add a non-breaking space (&nbsp to empty data cells, to make the borders visible:
HTML Code:
<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>&nbsp;</td>
</tr>
</table>
How it looks in a browser:
row 1, cell 1 row 1, cell 2 row 2, cell 1
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, HTML Tables in HTML / XHTML; HTML Tables Tables Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=5563


Bookmarks

Tags
html, tables


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Multiple MySQL Tables with Unique IDs, Joins and Normalization Developer Articles 0 26-11-2008 09:31 PM
Adobe FrameMaker Templates: Borders and Tables Pack 2 Developer Software and Programs 0 14-11-2008 11:50 PM
Adobe FrameMaker Templates: Borders and Tables Pack 2 Developer Software and Programs 0 14-11-2008 11:48 PM
Getting Rid of Tables Developer Articles 0 27-10-2008 09:43 PM
Lesson : HTML Linking to E-Mail in HTML Tutorial Developer Articles 0 17-10-2008 09:14 PM