473,387 Members | 1,493 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,387 software developers and data experts.

Table to div conversion

hsriat
1,654 Expert 1GB
I have general layout of all my pages as [html]<table width="100%" height="100%">
<tr>
<td background="top.png" height="20px"></td>
</tr>
<tr>
<td>
<!--
WHOLE PAGE GOES HERE
-->
</td>
</tr>
<tr>
<td background="bottom.png" height="20px"></td>
</tr>
</table>[/html]
This sets a top and bottom graphical bar on the page even if the text inside the whole page is just 2 lines.

I have to retain the same layout but remove tables.
How can i do this?
Mar 3 '08 #1
8 4529
drhowarddrfine
7,435 Expert 4TB
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<title>Untitled Document</title>
<style type="text/css">
*{margin:0}
body{height:100%}
#top{background-image:url(top.png);height:20px}
#middle{height:100%}
#bottom{
background-image:url(bottom.png);
height:20px;
width:100%;
position:absolute;
bottom:0;
margin-bottom:0px
}
</style>
</head>
<body>
<div id="top"></div>
<div id="middle">
<p>Whole body content</p>
</div>
<div id="bottom"></div>
</body>
</html>[/HTML]
Mar 3 '08 #2
hsriat
1,654 Expert 1GB
Thanks dude!!

Now just I have to do is to add this to my template.php

Thanks again...

Harpreet :)
Mar 3 '08 #3
hsriat
1,654 Expert 1GB
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<title>Untitled Document</title>
<style type="text/css">
*{margin:0}
body{height:100%}
#top{background-image:url(top.png);height:20px}
#middle{height:100%}
#bottom{
background-image:url(bottom.png);
height:20px;
width:100%;
position:absolute;
bottom:0;
margin-bottom:0px
}
</style>
</head>
<body>
<div id="top"></div>
<div id="middle">
<p>Whole body content</p>
</div>
<div id="bottom"></div>
</body>
</html>[/HTML]
I think
Expand|Select|Wrap|Line Numbers
  1. body{height:100%}
is not working
Mar 4 '08 #4
drhowarddrfine
7,435 Expert 4TB
In what way? Which browser? It works for me.
Mar 4 '08 #5
hsriat
1,654 Expert 1GB
In what way? Which browser? It works for me.
Sorry, its working fine. Actually I had modified it a bit. May be I had removed something which was creating problem.

Actually I'm not able to convert my page to a table-less layout. I modified your above given code. And it works fine when no DOCTYPE is given. When I provide a DOCTYPE , instead of rendering the content in the center, it goes to the top.

And I am developing it on Mozilla only.
Mar 4 '08 #6
drhowarddrfine
7,435 Expert 4TB
Without a doctype, you are in quirks mode, not standards mode. All new pages are required to have a doctype.

Also, you are using xhtml end tags but quirks mode is html only. There are html errors, too.
Mar 4 '08 #7
hsriat
1,654 Expert 1GB
Without a doctype, you are in quirks mode, not standards mode. All new pages are required to have a doctype.

Also, you are using xhtml end tags but quirks mode is html only. There are html errors, too.
ok, just tell me, should I convert the table layout into div for such a light weight page or I should let it be like that?

Also I modified it and now according to w3validator, it has only two errors.
1. there is no attribute "height". <table width="100%" height="100%">
2. there is no attribute "name". <form name="F" action="/index.php" method="post">

What can I do with this now?
Mar 4 '08 #8
hsriat
1,654 Expert 1GB
Thanks :)
I got it working now, and no errors.

Harpreet
Mar 4 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mahesh Hardikar | last post by:
Hi , Oracle 8.1.7.0.0 on HP-UX 11.0 I am a newbie as far as PL-SQL is concerned . I have Sybase/MSSQL T-SQL background. We have a report which uses a select statement . This select...
5
by: Jonas Asberg | last post by:
Hi, I got a new SQL Server database and are in the process of porting my Access databases to my new SQL Server. I have worked with Access and Oracle in the past but I am new to the SQL Server...
6
by: Tony Johansson | last post by:
Hello Experts! I have the user defined class called Boolean that should be handle all kind of logic expression such as if (a && b && c) or if (!a && b && c) osv I have the class definition...
4
by: MLH | last post by:
My table has an autonumber field and a text field named . Many records have unnecessary spaces padding the front and end of - at least, I think they're spaces. The look like spaces to me. ...
6
by: Pawel Janik | last post by:
Hello.. I have some static functions, that do somple conversion. But to do this conversion, I have to use some conversion tables. And now the question: how to fill this conversion tables (the...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
0
by: timnels | last post by:
I've got a bizzare issue where I have an XML file to load into a data set like: <conversion> <table name="parent"> <table name="child"> </table> </table> <table name="another parent"> ....
5
by: Shibu | last post by:
Hi, I have a situation where I need to convert business objects to a flat table. The reverse is also required. I am using c# and Oracle ODP. I am looking for an easier method to do the below...
6
by: Peter Afonin | last post by:
Hello, I'm creating something like a web site builder in ASP.Net, and I need to store an HTML code in the SQL server table. If my customer just enters an HTML code, it is stored in the SQL...
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.