Jump to content

html layout problem


hamza

Recommended Posts

there is a code below actually the problem is

in first row i have 2 td's and in 5th row i have 2 td's as well

but

when i width of bot rows td's are not accepting different widht

as you see in the code

row 1 td's have different width

row 5 td's have different width

but both are accepting one width

why this is happening?

 

 

<html>

<head>

<title>index</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="css/style.css" rel="stylesheet" type="text/css">

</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!-- ImageReady Slices (wallpaper.psd) -->

<table width="750" height="750" border="1" cellpadding="0" cellspacing="0" align="center">

<tr>

<td width="50"><img src="images/index_01.jpg" width="404" height="72" alt=""></td>

<td width="96"><img src="images/index_02.jpg" width="346" height="72" alt=""></td>

</tr>

<tr>

<td colspan="2" width="750"><img src="images/index_03.jpg" height="21" alt=""></td>

</tr>

<tr>

<td colspan="2"><img src="images/index_04.jpg" height="26" alt=""></td>

</tr>

<tr>

<td colspan="2" width="750"><img src="images/index_05.jpg" height="70" alt=""></td>

</tr>

<tr>

<td width="200" height="750"> </td>

<td background="images/spacer.gif"> </td>

</tr>

<tr>

<td colspan="2">footer</td>

</tr>

</table>

<!-- End ImageReady Slices -->

</body>

</html>

Link to comment
Share on other sites

Your <img width="" height=""> attributes are overriding your <td width / height> attributes, causing the rows/columns to be as big as the pictures they contain.

 

I strongly suggest you stop where you are and go learn about CSS [Cascading Style Sheets] instead of using tables.  I can see you're using a WYSIWYG editor, but it would help you immensely to code some layout design using CSS to see the advantage and time saving as opposed to using tables.

 

Tables should be used for tabular data, not layouts.  You'll thank me later.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.