Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1645 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

XHTML code for a table

Thread title: XHTML code for a table
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
06-16-2008, 12:43 PM
#1
alisha is offline alisha
Status: Junior Member
Join date: Jun 2008
Location: India
Expertise:
Software:
 
Posts: 43
iTrader: 0 / 0%
 

alisha is on a distinguished road

  Old  XHTML code for a table

please tell the code for a table in XHTML.

06-16-2008, 01:17 PM
#2
BetaOrange is offline BetaOrange
Status: I love this place
Join date: Nov 2007
Location: Aberdeen, Scotland
Expertise: Design / Coding
Software: Photoshop, iTunes, Firefox
 
Posts: 660
iTrader: 9 / 100%
 

BetaOrange is an unknown quantity at this point

  Old

HTML Code:
<table></table>
This is the main table tags
HTML Code:
<tr></tr>
This is what makes a row
HTML Code:
<td></td>
This is what makes a column

HTML Code:
<table>
<tr>
<td>Hello</td>
</tr>
</table>
That would make a one row and one column table

HTML Code:
<table>
<tr>
<td>Column 1 </td>
<td>Column 2 </td>
</tr>
<table>
That gives us 2 Columns

HTML Code:
<table>
<tr>
<td>Row 1</td>
</tr>
<tr>
<td>Row 2</td>
</tr>
</table>
That gives you two rows

HTML Code:
<table>
<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>
That gives you a 2 columned, 2 rowed table.

06-16-2008, 04:29 PM
#3
LeetPCUser is offline LeetPCUser
LeetPCUser's Avatar
Status: Member
Join date: Aug 2006
Location: Wisconsin
Expertise:
Software:
 
Posts: 132
iTrader: 0 / 0%
 

LeetPCUser is on a distinguished road

Send a message via AIM to LeetPCUser Send a message via MSN to LeetPCUser Send a message via Yahoo to LeetPCUser

  Old

I wouldn't recommend tables unless you need to put tabulated data on your website. If you are trying to adhere to new standards and still making a site in a table, I would learn the benefits of CSS and re-code your site.

06-16-2008, 05:02 PM
#4
Jordan is offline Jordan
Jordan's Avatar
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
 
Posts: 1,187
iTrader: 7 / 100%
 

Jordan is on a distinguished road

  Old

Veerle has a great tutorial/example of a proper XHTML table.

Code:
<table id="mytable" cellspacing="0" summary="The technical
specifications of the Apple PowerMac G5 series">
<caption>Table 1: Power Mac G5 tech specs </caption>
<tr>
  <th scope="col" abbr="Configurations" class="nobg">Configurations</th>
  <th scope="col" abbr="Dual 1.8GHz">Dual 1.8GHz</th>
  <th scope="col" abbr="Dual 2GHz">Dual 2GHz</th>
  <th scope="col" abbr="Dual 2.5GHz">Dual 2GHz</th>
</tr>
<tr>
  <th scope="row" class="spec">Model</th>
  <td>M9454LL/A</td>
  <td>M9455LL/A</td>
  <td>M9457LL/A</td>
</tr>
...
http://veerle.duoh.com/index.php/blo..._styled_table/

06-16-2008, 08:27 PM
#5
Ethan is offline Ethan
Ethan's Avatar
Status: I'm new around here
Join date: Sep 2006
Location: US
Expertise: html, css, photoshop
Software: photoshop, notepad, wordpress
 
Posts: 22
iTrader: 0 / 0%
 

Ethan is on a distinguished road

  Old

Originally Posted by LeetPCUser View Post
I wouldn't recommend tables unless you need to put tabulated data on your website. If you are trying to adhere to new standards and still making a site in a table, I would learn the benefits of CSS and re-code your site.
I wouldn't completely count on that. So far I have tested over 15 different layout methods using div/css and every single one has atleast one aweful flaw with cross browser compatibility. I would say that until browsers decide to stop warring against eachother over standards, dont be afraid to use tables to make Stable layouts that display more correctly for all browsers than divs will.

06-16-2008, 08:37 PM
#6
LeetPCUser is offline LeetPCUser
LeetPCUser's Avatar
Status: Member
Join date: Aug 2006
Location: Wisconsin
Expertise:
Software:
 
Posts: 132
iTrader: 0 / 0%
 

LeetPCUser is on a distinguished road

Send a message via AIM to LeetPCUser Send a message via MSN to LeetPCUser Send a message via Yahoo to LeetPCUser

  Old

Ethan,

As long as you know how to correctly utilize CSS and the appropriate hacks it will look better than tables.

06-17-2008, 02:35 AM
#7
rochow is offline rochow
rochow's Avatar
Status: Member
Join date: Oct 2006
Location: Australia
Expertise:
Software:
 
Posts: 297
iTrader: 4 / 100%
 

rochow is on a distinguished road

Send a message via MSN to rochow Send a message via Skype™ to rochow

  Old

Originally Posted by Ethan View Post
I wouldn't completely count on that. So far I have tested over 15 different layout methods using div/css and every single one has atleast one aweful flaw with cross browser compatibility. I would say that until browsers decide to stop warring against eachother over standards, dont be afraid to use tables to make Stable layouts that display more correctly for all browsers than divs will.
I disagree wholeheartedly.

You have tested different methods. If its not done properly, then of course its not going to work.

Look at it this way. 95% of people use standards compliant browsers (well, standards enough)

For the sake of 5% of people (keeping in mind every other site they visit will look rubbish anyway) are you going to make your site have:
- Slow loading times
- Increased server load
- Decreased flexibility for changes
- Decreased search engine rankings due to excessive markup and not as much content

Of which, having slower loading times and lower search engine rankings will lose customers anyway - so making your site work for 5% extra people, and in turn losing more than 5% of business, is just stupid.

CSS for the win.

06-17-2008, 03:55 AM
#8
icanfreelance is offline icanfreelance
icanfreelance's Avatar
Status: I'm new around here
Join date: Jun 2008
Location:
Expertise:
Software:
 
Posts: 14
iTrader: 0 / 0%
 

icanfreelance is on a distinguished road

  Old

I sort of agree with CSS always will look better but for the newbee you should try sticking with tables as CSS would be a bit complicated to begin with. If you have a general understanding of CSS then go for it.

06-17-2008, 01:11 PM
#9
LeetPCUser is offline LeetPCUser
LeetPCUser's Avatar
Status: Member
Join date: Aug 2006
Location: Wisconsin
Expertise:
Software:
 
Posts: 132
iTrader: 0 / 0%
 

LeetPCUser is on a distinguished road

Send a message via AIM to LeetPCUser Send a message via MSN to LeetPCUser Send a message via Yahoo to LeetPCUser

  Old

I started with CSS because I was told if you start with tables you are going to develop bad habits.

06-17-2008, 10:30 PM
#10
Ethan is offline Ethan
Ethan's Avatar
Status: I'm new around here
Join date: Sep 2006
Location: US
Expertise: html, css, photoshop
Software: photoshop, notepad, wordpress
 
Posts: 22
iTrader: 0 / 0%
 

Ethan is on a distinguished road

  Old

Originally Posted by rochow View Post
I disagree wholeheartedly.

You have tested different methods. If its not done properly, then of course its not going to work.

Look at it this way. 95% of people use standards compliant browsers (well, standards enough)

For the sake of 5% of people (keeping in mind every other site they visit will look rubbish anyway) are you going to make your site have:
- Slow loading times
- Increased server load
- Decreased flexibility for changes
- Decreased search engine rankings due to excessive markup and not as much content

Of which, having slower loading times and lower search engine rankings will lose customers anyway - so making your site work for 5% extra people, and in turn losing more than 5% of business, is just stupid.

CSS for the win.
I was on that boat for a while, I went to college for web design and taught CSS to people myself. But it seems that I still come across instances (even simple ones), where even when I consult those who are even better than me with CSS (including this site as well), CSS with divs have failed stability.

Don't get me wrong, I prefer CSS in general over the majority of the point, yet CSS still has flaws concerning cross browser stability in many instances, not because CSS isnt better than tables, but because browsers and standards have not yet come full circle in making CSS/divs work together with them completely.

Also, don't get me as if I'm saying "defintely use tables, they are better", no, rather I'm saying, those little nicks where you can't seem to find any other solution, even from the experts, don't be afraid to use tables every now and then until standards and browsers do start cooperating better.

Closed Thread  
Page 1 of 2 1 2 >


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed