473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Tableless layout problem - please help!

Hi,

I'm a newbie, and I'm trying to recreate the table below in CSS:

<table border="1" width="100%" id="table1">
<tr>
<td width="145">Player Name::</td>
<td>Pele</td>
</tr>
<tr>
<td width="145">Nationality::</td>
<td>Brazil</td>
</tr>
<tr>
<td width="145">World Cup Debut:</td>
<td>1956</td>
</tr>
<tr>
<td width="145" valign="top">Highlight:</td>
<td>For many, Pele is the greatest player ever to have
kicked a
football. Winning his first World Cup winner's medal
aged 16 in 1956, he
later went on to be a member of the Brazil 1970 team,
the greatest world
cup team ever, and the most recognisable ambassador
for Football in the
world.</td>
</tr>
</table>
I need it so that it resizes then wraps the second column, whilst the
first column stays fixed, like in the table, and the text from the
second column doesn't appear beneath the first column text.

The information really isn't suited to go in a table, as IMHO its not
tabular data, just headings and related text.

Any assistance is greatly appreciated.

Cheers,

Richard Lissimore.
Jul 20 '05 #1
2 1650
On Tue, 31 Aug 2004 21:51:15 +0100, Richard Lissimore wrote:
<td>Pele</td>
So this is the 'Player' column,..
<td>Brazil</td>
'Team/Nationality' column,..
<td>1956</td>
'Year' column,..
<td width="145" valign="top">Highlight:</td>
(this should be a column header,) for the..
<td>For many, Pele is the greatest player ever to have


'Highlight' column of this..
*TABLE* of information, fer chrissake!

Do not use tables for *presentation*.

*Use* tables for columns and rows of
data, ..*exactly* like you have.

HTH

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #2
Richard Lissimore wrote:
I'm a newbie, and I'm trying to recreate the table below in CSS:
Following up on A. Thompson: You cannot recreate an HTML element in
CSS, even if you might be able to recreate some of the visual layout
aspects of an element as many browsers display it. What you have is a
table, so use table markup for it. It is remarkable that "Don't use
tables for layout" has become "Don't use tables" period.
<table border="1" width="100%" id="table1">
Feel free to move the border and width attributes out of the page and
use css instead. Consider using an id that is more meaningful, too.

<table id="playerstats">

table#playerstats {
width: 100%;
}

table#playerstats th, table#playerstats td {
border: 1px solid #000;
}
<tr>
<td width="145">Player Name::</td>
<td>Pele</td>
</tr>
It looks like the first column contains headers for the second
column. So change the markup slightly.

<tr>
<th>Player Name::</th>
<td>Pele</td>
</tr>

Then change the presentation with css. Note, though, that pixels are
the wrong choice for setting widths on screen, where you don't know
the display medium's properties. Either use percentages, or go with em
units.

table#playerstats th {
width: 145px; /* bad, use something more flexible */
}

Note that th is often displayed bold and centered. If you don't
want that, and want to use em units for width, try this:

table#playerstats th {
width: 15em; /* change 15 to whatever number works best */
font-weight: normal;
text-align: left;
}
The information really isn't suited to go in a table,
! It looks like tabular data to me.
as IMHO its not tabular data, just headings and related text.


Erm, isn't that what tabular data *is*?

--
Brian

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Amy | last post by:
Hello all, Well, I've decided to take the plunge and go for this no table theory... so far I'm not impressed - the whole thing is driving me mad!!!! I'm sure once I finally get it working...
21
by: fleemo17 | last post by:
I'm diving into the world of CSS and am blown away by the power of it. I'm redesigning a website, trying to eliminate the tables in the layout in favor of CSS. However I've come across a stumbling...
6
by: glakk | last post by:
I got on the tableless layout bandwagon early on, and thought it was a really cool way to lay out a page. I don't know why I thought it was so cool, except I guess I fell for the "oh, cool" talk. ...
6
by: ThunderMusic | last post by:
Hi, I think the subject says it all... thanks ThunderMusic
4
by: ge5talt | last post by:
Longtime reader, 1st time poster :) I am in the process of overhauling a website and replacing an old table-based quirksmode layout with a standards-mode tableless one. I am currently working on...
3
by: Paulo | last post by:
Hi everybody, I heard about TableLess layout, css, etc... What is it? Any advantages using it? Is it client feature? nothing to do with asp.net? Should it be used with asp.net? What do you...
4
by: parez | last post by:
can any one point me to a good link on tableless design + asp.net master pages TIA
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.