Jump to content

CSS table issue, extremely long link problem


krum110487
 Share

Recommended Posts

ok I have an issue where there is a div, then table, then div then link...

<div class=bleh>  <table>	<tr>	  <td>		<div class=different>		  <a href="link">REALLY LONG LINK</a>		</div>	  </td>	</tr>  </table></div>

I have a situation where the outside div is being set to the width of the content within it, what I want is the outside div to fit to the width of the screen (at max) and the inner content I want it to be word wrapped, to prevent long links and no space text.this needs to work on Firefox, IE7/8, Chrome, SafariThanks for the help

Edited by krum110487
Link to comment
Share on other sites

well, they both have the same class, so what's that class doing? Without a width setting the div should automatically take up the width of its container. Perhaps you should just only use the a tag, no inner div, and style it accordingly to get the text effect you want to achieve.

Link to comment
Share on other sites

well, they both have the same class, so what's that class doing? Without a width setting the div should automatically take up the width of its container. Perhaps you should just only use the a tag, no inner div, and style it accordingly to get the text effect you want to achieve.
sorry about that misleading bleh class, I didn't mean to make them exactly the same, I was writing it from memory. I've altered it slightly.well I want the inner div to fill out the outer div, but I don't want it to stretch it off screen. I can make the inner text wrap just fine if I set a width, but depending on the size of the screen the width will be different, percentages doesn't seem to work.
Link to comment
Share on other sites

ok I have an issue where there is a div, then table, then div then link...
<div class=bleh>  <table>	<tr>	  <td>		<div class=different>		  <a href="link">REALLY LONG LINK</a>		</div>	  </td>	</tr>  </table></div>

I have a situation where the outside div is being set to the width of the content within it, what I want is the outside div to fit to the width of the screen (at max) and the inner content I want it to be word wrapped, to prevent long links and no space text.this needs to work on Firefox, IE7/8, Chrome, SafariThanks for the help

ok so what CSS do you have for BLEH and DIFFERENT? I note also there are not quotes in your example and perhaps this is why some of this is not workingi wrote the style inline in the example but you may prefer to put in the style sheet. Sometimes we use DIVs when they are not required. Here all you need is a BLOCK level element and <p> will do nicely
[code]<div class=bleh>  <table>	<tr>	  <td>		<p style="width:50%;">		  <a href="link">REALLY LONG LINK</a>		</p>	  </td>	</tr>  </table></div>

try this with various screen widths and adjust 50% up or down as needed[/code]now if the text for your REALLY LONG LINK has nothing that can be interpreted as whitespace, you will need more help. Try first with plain text to ensure you get what you want for width. Guy

Edited by Guy Cousineau
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...