The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Writing inside tables, text keeps going on new line
HLA91
post Mar 4 2007, 01:22 PM
Post #1


Member
***

Group: Members
Posts: 33
Joined: 11-February 07
From: South Wales
Member No.: 1,861



Hi
I was using this code for a table

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table border="1" width="1037" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" width="394">
<p align="right">Welcome to Crazed Climbing Competition</td>
</tr>
<tr>
<td width="97" height="105"valign="top"> Home&nbsp;&larr;<p>
<a href="climbing_locations.htm"><font size="4">Climbing Locations</font></a></p>
<p><a href="contact_us.htm"><font size="4">Contact Us</font></a><p>
<a href="history_of_rock_climbing.htm"><font size="4">History of Rock Climbing</font></a><p>
<a href="links_page.htm"><font size="4">Links Page</font></a></td>
<td width="291" valign="top">
<p align="Top"> <font face="Arial Unicode MS">
<font size="4" color="#FF0000">W</font><font size="4">elcome to the Crazed
Climbing&nbsp; Competition website. This page is
your gateway to all the information you will need to know about the
competition. To find out where the competition is held please visit the <!--Main cell--></font></font></td>
</tr>
</table>

</body>
</html>

When I tried to write in the main cell the writing would go a quarter of the way across then it would go underneath as if someone pressed enter. WHY?
I've asked my friends but they can't help.

Thankyou

HLA91
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
JamieHarrop
post Mar 4 2007, 01:45 PM
Post #2


Advanced Member
****

Group: WDG Moderators
Posts: 129
Joined: 25-October 06
From: West Yorkshire, UK
Member No.: 570



That is because you have assigned a width of 291px to the main cell. If you assign it a width like that, text will fall to the next line once it reaches the end of the 291px.

Removing width="291" from the <td> will fix it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 4 2007, 02:01 PM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 16,348
Joined: 9-August 06
Member No.: 6



I'd remove all widths. Now you say the whole table should be 1037 pixels (which is too wide for a fixed design). The first row should be 394 pixels. The second row should be 97 + 291 = 388 pixels. That doesn't add up at all.

You could make the whole table 100% or 75% or whatever. For the navbar you could also use a percentage. You can use pixels if you prefer, but 97 pixels isn't much on my standard sized screen. The other cells don't need a width.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 4th September 2015 - 07:22 AM