|
|
|
|
Thread title: XHTML code for a table |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
06-16-2008, 12:43 PM
|
#1
|
Status: Junior Member
Join date: Jun 2008
Location: India
Expertise:
Software:
Posts: 43
|
XHTML code for a table
please tell the code for a table in XHTML.
|
|
06-16-2008, 01:17 PM
|
#2
|
Status: I love this place
Join date: Nov 2007
Location: Aberdeen, Scotland
Expertise: Design / Coding
Software: Photoshop, iTunes, Firefox
Posts: 660
|
HTML Code:
<table></table>
This is the main table tags
This is what makes a row
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
|
Status: Member
Join date: Aug 2006
Location: Wisconsin
Expertise:
Software:
Posts: 132
|
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, 08:27 PM
|
#4
|
Status: I'm new around here
Join date: Sep 2006
Location: US
Expertise: html, css, photoshop
Software: photoshop, notepad, wordpress
Posts: 22
|
Originally Posted by LeetPCUser
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-17-2008, 02:35 AM
|
#5
|
Status: Member
Join date: Oct 2006
Location: Australia
Expertise:
Software:
Posts: 297
|
Originally Posted by Ethan
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, 10:30 PM
|
#6
|
Status: I'm new around here
Join date: Sep 2006
Location: US
Expertise: html, css, photoshop
Software: photoshop, notepad, wordpress
Posts: 22
|
Originally Posted by rochow
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.
|
|
06-18-2008, 12:05 AM
|
#7
|
Status: Member
Join date: Oct 2006
Location: Australia
Expertise:
Software:
Posts: 297
|
Originally Posted by Ethan
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.
|
Can you name a couple of the situations where CSS has failed?
I'm not anti-tables, as far as more complex forms go I'll use tables rather than CSS (as using <p> for each line is not semantic, as much as so many people round here love to think so) as its quicker, easier, doesn't increase loading time (as its just text and inputs, not images that have to be sliced badly to fit into the tables format)
Not to mention, last time you looked a form, it looked tabular right? So why not just use tables. Its one of the only times I will jump off the "perfectionist" bandwagon and jump onto the "practically first" one.
|
|
06-25-2008, 11:10 AM
|
#8
|
Status: Junior Member
Join date: Jun 2008
Location: India
Expertise:
Software:
Posts: 43
|
please tell me something about CSS.
|
|
06-19-2008, 04:26 AM
|
#9
|
Status: Junior Member
Join date: Jan 2008
Location: on CSS
Expertise:
Software:
Posts: 63
|
Originally Posted by rochow
- Slow loading times
- Increased server load
- Decreased flexibility for changes
- Decreased search engine rankings due to excessive markup and not as much content
|
I would add that 1,2 and 4 aren't really associated with tables but bad coded tables and inline styling.
|
|
06-19-2008, 07:28 AM
|
#10
|
Status: Member
Join date: Oct 2006
Location: Australia
Expertise:
Software:
Posts: 297
|
Originally Posted by VimF
I would add that 1,2 and 4 aren't really associated with tables but bad coded tables and inline styling.
|
Everything depends on the design, however:
1) They are for sure - because of the tabular layout, images have to be sliced not so optimally to fit with the content (assuming the site has images, ofc)
2) Tables are still heavier. If you have 2 hits a day, who cares. If you serve a billion pageviews a month, you'll care a ton. That 1kb adds up (and at the end of the day saves $$$ which is the whole goal)
4) This one is 50/50. Some designs have tons of sidebar trash on the left, pushing the content (on the right) way way down in the source. Other designs have content up the top left, so using tables doesn't have an effect. With CSS though (and positioning or margins) content can be put after the header before any sidebars, no matter the layout.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
|
|