473,524 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

css replacing tables

Hi again
i want to replace the following layouttabel with css/xhtml:
----------------------------------
<table width="640" cellspacing="0">
<tr>
<td valign="top">My Title</td>
<td valign="top">my text </td>
</tr>
<tr>
<td><img src="spacer.gif" width="140" height="1" /></td>
<td><img src="spacer.gif" width="500" height="1" /></td>
</tr>
</table>
---------------------------------

Is there a good way to accomplish this with compatible css?
Jul 23 '05 #1
7 4901
Els
Wilhelm Kutting wrote:
Hi again
i want to replace the following layouttabel with css/xhtml:
----------------------------------
<table width="640" cellspacing="0">
<tr>
<td valign="top">My Title</td>
<td valign="top">my text </td>
</tr>
<tr>
<td><img src="spacer.gif" width="140" height="1" /></td>
<td><img src="spacer.gif" width="500" height="1" /></td>
</tr>
</table>
---------------------------------

Is there a good way to accomplish this with compatible css?


Of course there is:
<div id="container">
<div id="title">My Title</div>
<div id="content">my text</div>
</div>

styles:
#container{width:640px;}
#title{width:140px;}
#content{width:500px;}

Now stop trying to do table layouts with CSS, and start using
CSS layouts. It will be very different from tables, not
everything can be reproduced in exactly the same way, but
that's not necessary.
Just set it up in CSS, forget about the tables.

Oh, and try to forget you ever heard about spacer gifs.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 23 '05 #2
Els wrote:
Wilhelm Kutting wrote:

Hi again
i want to replace the following layouttabel with css/xhtml:
----------------------------------
<table width="640" cellspacing="0">
<tr>
<td valign="top">My Title</td>
<td valign="top">my text </td>
</tr>
<tr>
<td><img src="spacer.gif" width="140" height="1" /></td>
<td><img src="spacer.gif" width="500" height="1" /></td>
</tr>
</table>
---------------------------------

Is there a good way to accomplish this with compatible css?

Of course there is:
<div id="container">
<div id="title">My Title</div>
<div id="content">my text</div>
</div>

styles:
#container{width:640px;}
#title{width:140px;}
#content{width:500px;}

Now stop trying to do table layouts with CSS, and start using
CSS layouts. It will be very different from tables, not
everything can be reproduced in exactly the same way, but
that's not necessary.
Just set it up in CSS, forget about the tables.

Oh, and try to forget you ever heard about spacer gifs.

Ok,
just starting....
Watched a lot of good links to css-layout on Your Homepage.
Is there a way to do css-layouts with dreamweaver?
I only know the dreamweaver way with div.
Jul 23 '05 #3
Els
Wilhelm Kutting wrote:
Ok,
just starting....
Watched a lot of good links to css-layout on Your Homepage.
Is there a way to do css-layouts with dreamweaver?
I only know the dreamweaver way with div.


Eh... divs are really good for flexible design and use of CSS.
I know nothing about Dreamweaver though.

You're not saying you don't know how to write HTML by hand, are
you?
--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 23 '05 #4
Els wrote:
Wilhelm Kutting wrote:

Ok,
just starting....
Watched a lot of good links to css-layout on Your Homepage.
Is there a way to do css-layouts with dreamweaver?
I only know the dreamweaver way with div.

Eh... divs are really good for flexible design and use of CSS.
I know nothing about Dreamweaver though.

You're not saying you don't know how to write HTML by hand, are
you?

I know how to write html by hand but you can make a big threat oout of
the discussion, if you prefer wysiwyg-editor or handcoded stuff.
Me, for myself, will stay to dreamweaver because i like it much to
layout a page visually.
The bad thing about Dreamweaver is, that they hide the css-layout thing
a little bit in the new mx-version.
Jul 23 '05 #5
Els
Wilhelm Kutting wrote:
You're not saying you don't know how to write HTML by
hand, are you?
I know how to write html by hand


Good :-)
but you can make a big
threat oout of the discussion, if you prefer wysiwyg-editor
or handcoded stuff. Me, for myself, will stay to
dreamweaver because i like it much to layout a page
visually. The bad thing about Dreamweaver is, that they
hide the css-layout thing a little bit in the new
mx-version.


Can't comment on that, as I've never even seen a Dreamweaver
screenshot... :-)

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 23 '05 #6
Wilhelm Kutting wrote:
Els wrote:

You're not saying you don't know how to write HTML by hand, are you?

I know how to write html by hand but you can make a big threat oout of
the discussion, if you prefer wysiwyg-editor or handcoded stuff.


You may know HTML (or tag soup seeing that table layout you originally
sent), but the problem is not completely that you are using a WYSIWYG
editor, the problem is that you have asked a question about how do I use
CSS to make a layout equivalent this table layout I have. You have also
done so in an HTML newsgroup. Instead, you should be asking questions
more like:

"I have this content, and it is broken into 3 sections. A header,
main content and navigation. How do I present these the main
content and navigation as columns, with the header above?"

That's probably not exactly what you have, but it's a generic example of
the kind of questions that should be asked about CSS layout. CSS
depends on well structed content for it to be successfully, and easily
applied. It does not dependon knowing how you want the page to look
before you write the content. However, because this is an HTML group, I
will focus more on your mark up problems and show you how to correctly
strucutre a document ready for CSS layout.
Me, for myself, will stay to dreamweaver because i like it much to
layout a page visually.
Dreamweaver is good, I use it myself, but do not write the markup of a
page and do the layout at the same time. This means, avoid WYSIWYG
editors, especially while your still learning.

Write your document by thinking about it's content. It's ok to decide
from the beginning that you want a two colum layout with left sidebar
for navigation, blog roll, etc. and right column for main content with a
header at the top of the page. If you think about it, that is actually
also helping to decide on the structure. But then, after you've thought
about the basic layout, it's more important that you think about the
content, and then the structure of each. For each of those sections,
start with a div, giving each an appropriate id.

<div id="header"></div>
<div id="body">
<div id="content"></div>
<div id="navigation"></div>
</div>

(I left footer off, because the can be difficult, but not impossible
with CSS column layouts, given CSS support in IE)

Forget about how these will become columns for now, that will come with
the CSS later.

After that, you need to decide what content you actually want in each
section. Markup your headings (in order, from <h1> to <h6> depending on
their level) and fill in some sample content just to get you started.

<div id="header">
<h1>Site Name</h1>
</div>
<div id="body">
<div id="content">
<h2>Page Title</h2>
<p>content...</p>

<h3>Subsection</h3>
<p>more content...</p>

<h3>Another Subsection</h3>
<p>more content...</p>
</div>
<div id="navigation">
<ul id="sitenav">
<li>...</li>
</ul>
<ul id="blogroll">
<li>...</li>
</ul>
</div>
</div>

Fill in your content with paragraphs, tables, lists, etc. Don't even
think about applying style until you have it making complete sense, and
structurally correct in all it's unstyled glory. Visit a few sites that
use CSS layouts and disable stylesheets to see how they're structured.

With that markup, you'll be all set to start looking into colum based
layouts. Position is Everything [1] and Glish.com [2] have some good
css resources for making columns and various other things with CSS.
The bad thing about Dreamweaver is, that they hide the css-layout thing
a little bit in the new mx-version.


The bad thing about Dreamweaver and other WYSIWYG editors is that the
easiest way to achieve a flexible layout is using tables. Dreamweaver
is getting better, but even Dreamweaver 2004 can produce nasty markup if
you only use the WYSIWYG editor, especially if you don't really
understand structured markup. It is important to constantly monitor and
clean the markup it produces, so more often than not you'll save time
and effort by simply writing the markup by hand. From my experience, it
takes someone with good handcoding skills to handle a WYSIWYG
environment correctly, but then people that experienced generally prefer
handcoding anyway, for most things.

[1] http://positioniseverything.net/
[2] http://glish.com/css/

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 23 '05 #7
Wilhelm Kutting wrote:
i want to replace the following layouttabel with css/xhtml:
Stop wanting that. Instead, (re)write the markup alone, just xhtml
strict. (Actually, I'd recommend html 4.01 strict, unless you have a
need for xhtml and you understand the problems associated with it.)

Use the correct markup for the job. When you're done, take a look at the
default rendering in a browser, and change what you don't like with css.
<table width="640" cellspacing="0">
<tr>
<td valign="top">My Title</td> [snip] Is there a good way to accomplish this with compatible css?


If you try to recreate table layouts with css, you'll just get frustrated.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #8

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

Similar topics

40
2664
by: Mason A. Clark | last post by:
CSS Experts: OK, I'm a stupid newby. Now, here's the question: Can CSS replace slightly complicated Tables and work in three browsers (e.g. MSIE 6.0, Net 7.1, Op 7.03) ? After countless attempts I've concluded "no". Thank you,
3
1572
by: Paolo | last post by:
Friends, I have a split database and would like to make some updates to share with all users in various Offices in the World. I would like just to send them a new mdb file which will contain the updated tables, queries and modules and with a form on which I will add a button that will replace these with the old ones. Is there a way I can do...
2
1788
by: dan graziano | last post by:
Hi, I currently have a five table and query system created in access. Basically the structure is fixed. But I have to run the query over numerous times using different updates of the tables. Four of the tables need to be replaced before I redo each query run. Rather than importing each of the four tables individually each time before I...
18
3921
by: blueapricot416 | last post by:
I am on a team designing the front end of an Intranet application. The backend guys will be using JSP and AJAX-like functionality to make server requests that must dynamically change elements on a page. What is the best way to create and populate tables, which will exist in floating DIVs (with drag and drop capability)? It only has to work...
7
1495
by: Leo Smith | last post by:
Hello, I am trying to replace a table that is setting inside a div tag. The reason is that I want to replace a table through AJAX instead of using postbacks or Iframes. The table is built on the server then sent back to the webpage as a string. I am trying to avoid parsing the string and recreating every control within the object. I had...
1
2340
by: gViscardi | last post by:
Hello all, Ok, so what I am attempting to accomplish is to replace my table-based website with a CSS layout site, but I have run into a few hitches. My main problem is that currently my website has sliced images that form the frame around some text, I take those slices and put them into a table and everything comes out fine. My table has...
1
2551
by: cma6 | last post by:
I have a page which uses tables for layout http://www.vintagetextile.com/1920s_to_1930s.htm The checkerboard pattern is achieved with this markup: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>1920s...
10
1905
by: Scott M. | last post by:
I've seen many posts and ready articles discussing how changing the membership & roles "provider" in VS .NET is easy, but have yet to see instructions on how to do it. If I already have SQL Server 2000 on a machine and didn't install SQL Server 2005 Express with my VS .NET installation, how do I set up my existing SQL 2000 server to be the...
1
7823
by: =?ISO-8859-1?Q?S=F8ren?= | last post by:
Hi guys I got the following code: ------------------------------------------------------- Dim Word As New Microsoft.Office.Interop.Word.Application Dim Document As Microsoft.Office.Interop.Word.Document Document = Word.Documents.Open(Filename)
0
7327
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7249
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7472
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7636
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
3308
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
873
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
537
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.