Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Writing inside tables

Posted by: HLA91 Mar 4 2007, 01:22 PM

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

Posted by: JamieHarrop Mar 4 2007, 01:45 PM

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.

Posted by: pandy Mar 4 2007, 02:01 PM

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.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)