Solved

problem with tables and hyperlinks

Posted on 2001-06-05
19
180 Views
Last Modified: 2010-04-09
I am using a table that has a middle width of 50% of the screen and side widths of 25% (the main content of a page appears in that middle area and other important side info appears in the side bars) -- my problem is that a few of my pages that are supposed to appear in the center of the screen have a number of hyperlinks (in the http:// format) -- for some reason, the normal wrapping that is supposed to occur with text doesn't occur with these hyperlinks and they push the boundry of that middle area far beyond its 50% setting (so that the whole page is screwed up and often doesn't even fit on the screen anymore).

Any suggestions?

Thanks!
0
Comment
Question by:Sunac
  • 5
  • 3
  • 2
  • +8
19 Comments
 
LVL 2

Expert Comment

by:CompuTurk
ID: 6157517
I am sorry to say that links are special cases in HTML and the worn't wrap.

You could try to hide those restless long URL in the code by saying; for example:

Please visit my guest book.

Instead of;

Please visit http://www.mydomain.com/long/verylong/cgi/guestbook.pl

I have gone into same problem myself. It is dead end.
0
 
LVL 4

Expert Comment

by:Gibble
ID: 6157625
The problem is that if you are using percentages to define the size of your table/cell whatever then it will automatically stretch the cell and there isn't anything you can do about it.  If instead you set the middle cell to absolute value like 500 instead of 50% it should wrap.
0
 

Author Comment

by:Sunac
ID: 6157661
Actually, putting an absolute value doesn't solve the problem -- there are certain "trouble" links that still push the boundries (like this one: http://www.law.com/cgi-bin/gx.cgi/AppLogic+FTContentServer?pagename=law/View&c=Article&cid=ZZZF1W4HGNC&live=true&cst=1&pc=0&pa=0&s=News&ExpIgnore=true&showsummary=0) --

Any other ideas/comments/suggestions out there?  Any terribly creative solution that would allow me to keep both my hyperlinks and my usage of % to define table width?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6157701
Well you are going to have to make some compromises here.  If a cross-browser
solution is required.  Then forget it! There is none.  If seeing the whole
url is critical tha you will have to do something in script or server side
to break it up, and the link will no longer be clickable.

Now a solution.  Works for IE 5+ only and a little styling.  The table
must be forced to fixed layout.  when you do that it will retain the width
percentages no matter what.  If it can't wrap something that is too big
then it clips it on the right side and shows as much as it can.  The rest
is there but hidden.

Drop this in your browser:


<html>
<head>
<style>
   table {table-layout:fixed}
</style>
</head>
<body>
<table border="1">
   <tr>
      <td width="25%">
          some stufff for the cell that should get wrapped i think</td>
      <td width="50%">
          This won't need to wrap</td>
      <td width="25%"> and we also want this to wrap to set up the big
                       middle cell in the next row </td>
   </tr>
   <tr>
      <td> a little</td>
      <td>aaaaaaaaaaareallyreallyreallylonstringwithnospaaaaaaaaaaaaaaaaacestowraponIIIIIImeanreallllllllllllllllylooooooooooong
      </td>
      <td> a little more</td>
   </tr>
   <tr>
      <td> how does </td>
      <td>this work</td>
      <td> ? </td>
   </tr>
</table>
</body>
</html>
     


Cd&
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6157707
As was said before -- don't show the acutal hyperlink. Put text in there, and not the URL.

Especially with something like that, there's really no reason. Nobody is going to write it down or anything. And it gives no indication of what it is or where it goes. I'd rather see something like 'Yahoo search page for North American recyclers' or 'Article about my third cousin twice removed' -- then I can better decide if I want to go there or not. ;-)
0
 
LVL 2

Expert Comment

by:elstcb
ID: 6157713
Where do the hyperlinks come from?

I had the same problem with dynamically created links a while back so ended up with the work around of truncating them to 40 characters and adding "...." to the end of any truncated ones.

e.g. (and this will never work in EE...!)

<a href="http://www.law.com/cgi-bin/gx.cgi/AppLogic+FTContentServer?pagename=law/View&c=Article&cid=ZZZF1W4HGNC&live=true&cst=1&pc=0&pa=0&s=News&ExpIgnore=true&showsummary=0)">http://www.law.com/cgi-bin/gx.cgi/AppLogic....</a>

HTH,

Steve
0
 
LVL 2

Expert Comment

by:kneea
ID: 6157788
Use a description like everyone says.  If the mouse is held on the link the url will be displayed at the base of the window of both explorer and netscape.  You could also use the title tag so that it was more obvious.

<a href="http://www.law.com/cgi-bin/gx.cgi/AppLogic+FTContentServer?pagename=law/View&c=Article&cid=ZZZF1W4HGNC&live=true&cst=1&pc=0&pa=0&s=News&ExpIgnore=true&showsummary=0" title="http://www.law.com/cgi-bin/gx.cgi/AppLogic+FTContentServer?pagename=law/View&c=Article&cid=ZZZF1W4HGNC&live=true&cst=1&pc=0&pa=0&s=News&ExpIgnore=true&showsummary=0">Left Builds Case Against Bush Judges</a>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6157812
Actually when you put the full link in it does some wrapping it breaks at the hyphen in cgi-bin and at the question mark.  The third line is still too long, and gets clipped; but the link is clickable. Even though oart of it is hidden it does not matter unless you need to see it all in which case you be find a new design.

Cd&
0
 
LVL 2

Expert Comment

by:kneea
ID: 6157970
Because of what CD said,

...try adding some spaces in the visible url so that the line can be split?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Expert Comment

by:SamuelGasper
ID: 6165498
Why do you put in a table. A frameset with will raise less troubles
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6198956
Sunac,

There has not been any comments for 9 days, so I believe all the workarounds have been presented.  Where are we going with this?

Cd&
0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6217035
Days passing without comments from the person posting the question usually means the answer(s) aren't liked, especially when they say "What you want can't be done.", even though they may be the unvarnished truth.

Consensus says: "Use short text".

Opinion: Never do anything which will work only for one or two browsers.  If it is not portable, don't use it.
0
 
LVL 4

Expert Comment

by:Gibble
ID: 6218370
>>Opinion: Never do anything which will work only for one or two browsers.  If it is not portable, don't
use it.

Umm...so I can only use the <b>, <i>, <u>, and <br> tags now. :(
0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6218859
Well, Gibble, I guess that depends on how important it is to you that everyone be able to see what you intended.

In addition to bold, italic, and underline, you also have the <font> tag plus the <h1>, <h2>, etc., tags.

Rather than <b> you could use <strong>, rather than <i> you could use <em>, so that text-to-speech browsers could do The Right Thing.

With all the other options for aligning text and graphics(tables, frames, align="right"), why does anybody need to use things which work on one platform but not on others?

We sometimes lose track of the important thing: Content.
0
 

Expert Comment

by:teacher_mod
ID: 6374313
This question has been abandoned. Would the experts please indicate how
this should be closed out. Is there a comment which should be accepted?
Should the points be split? Should it be reduced to zero points and PAQed?
should it be deleted?  In the absence of direction, the default will be
for me to delete.

TIA for helping to clean up the old questions.

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com

0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6374536
It looks as if this question (along with one in the Windows 98 Topic Area) has indeed been abandoned.

Other than "It can't be done." and "Show short text, not the URL itself.", there have been no portable, solid answers here.

Delete the question, IMHO.

If you decide to make it a PAQ, CompuTurk gave the first, best answer: "... links are special cases [...] and [won't] wrap.  It is [a] dead end."
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6375537
There are som good answers but they are not for the question asked, because the user is not prepared to face relaity and compromise.

The answer to the question ask is "you Are stuck with the technology" ... first supplied by CompuTurk.

So award the points.  or Zero PAQ.  DO NOT REFUND the points.  

Cd&
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 0 total points
ID: 6519709
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
make a zero PAQ

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 6521556
Paq'ing with no refund of points
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now