Solved

Table sizing

Posted on 1998-11-23
9
136 Views
Last Modified: 2010-04-09
I want to know exactly how the netbrowser determines the width and height of cells in a table. I know it depends on the contents of a cell and i know too that WIDTH= and HEIGHT= in a <TD> tag are in most cases simply ignored. I want to use tables to position blocks of text and images on an exact location. A browsers own interpretation of WIDTH= and HEIGHT= messes up my layout really bad.
0
Comment
Question by:joostjag
9 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1839998
You can use CSS which will place the things *exactly* where you want them:

Inside <HEAD></HEAD>:
<STYLE>
<!--
#myDiv {
  position: absolute;
  top: 100;
  left: 10;
}
// -->
</STYLE>

Somewhere in document:
<DIV ID="myDiv">Content</DIV>

If you use position: relative, the content will be placed 100 pixels under the last component added (the position is relative). If you use absolute it'll be absolute ie from top left corner of page. I don't know which of them you want.

Martin
0
 
LVL 1

Expert Comment

by:rajgn
ID: 1839999
I'm sorry, I don't agree with your views on WIDTH/HEIGHT attributes of a table/cell. perhaps, contradictory attributes may caused you feel like that(in that case browser will not behave in intended way). One key here is setting these attributes in '%' and 'pixels'. If you use '%' it's always going to be relative. On the otherhand setting in pixels is absolute. Hence there's always a possibility of a mixup, which may give us such impressions.

Using tables inside tables, virtually you can position text/images anywhere on the page. But it's implementable when you've any authoring tool like Frontpage(otherwise it's too labourious process to do manually). I did this successfully very recently to find how good are tables to position on a page(unfortunately I can't give you the URL since it's on Intranet)
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1840000
A way of solving the problem is to define width in the <table> tag and then again in the <td> tags. This is follproof (assuming you don't contradict yourself).
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:joostjag
ID: 1840001
I must admit I was wrong about the WIDTH/HEIGHT attributes. When I explicitly specified these for most cells the browser showed the table the way I wanted. It seems like omitting these attributes in some cells also causes other non-related cells to change size. That's why it seemed my browser ignored the WIDTH/HEIGHT attributes.
I'm creating HTML files in a plain text editor. Maybe using Frontpage will fix this sizing problem automatically.
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1840002
Using FrontPage sounds like a really bad idea to me. How about Allaire Homesite?
0
 
LVL 1

Expert Comment

by:rajgn
ID: 1840004
Well, as some of you said, I too don't like Frontpage which always messes up with the code. BUT if you refer to my last comment, I suggested this ONLY to avoid laborious process of laying down tables inside tables inorder to achieve perfect alignment of text/graphics. And is not a generalized solution.

Since 'martike' said plain text editor will allow you much more control over your HTML than FrontPage, I wanted to show you an example. Just refer to 'www.wipro.com'. Initially you don't feel something great with that page. But you try to do the same thing(i.e aligning all the menu item gif's with the central main gif) USING only NOTEPAD as your editor. Then tell me how much time you spend on doing that(be honest!, if at all you're successful). Now try doing the same thing with any HTML authoring tool(not only FP). Now you'll find the difference and will understand what I was saying.

Finally as 'martike' himself said, it all depends on what it is you really want, and how(slowly) do you want it(if you don't mind wasting time in changing width/height attributes of each cell in notepad)
0
 
LVL 6

Expert Comment

by:PBall
ID: 1840005
Hehe, that's why I like laying out my screen in Photoshop first since I can get very precise about the layout setting.

After doing so, even using Notepad to code the layout will not be so difficult.

FrontPage and all those other 'I know what you want and uhm...your syntax is incorrect, so let me add some junk codes to make it correct and hey, where is the end tag for this paragraph, and look...no quote here, let's add quote' web editors...what can I say..they suck.

So far, I can live with Interdev, but even with it I code my table manually.
0
 
LVL 1

Accepted Solution

by:
toTo earned 70 total points
ID: 1840007
use invisible pictures with the "good" size in a cell
in each column or line you want to recize.
0
 
LVL 1

Expert Comment

by:rajgn
ID: 1840008
martike:

You're right. In most cases I found Front page annoying. Particularly, it'll not allow you embed your own code. Most of the times it replaces your code with it's own tags.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Background video not displaying in Internet Explorer. 3 37
Obtaining data on ASP 8 28
jQuery Dialog Autoresize Bug 2 24
send email part1 9 22
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question