# Fixed Column Width--need help with html code!



## cstuart (May 22, 2009)

I am new to html code and am trying to create an email template where both the right and left columns will remain fixed so that the text entered does not cause the width to grow and the bottom still has the capability of growing. So far everything is working properly except that the right hand column will not remain fixed--can someone help me with this?

<html>
<head>
<title>NSX2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (NSX2.psd) -->
<table id="Table_01" width="792" height="1008" border="0" cellpadding="0" cellspacing="0" align=center>
<tr>
<td rowspan="3" width="57" height=100% bgcolor="#000000">            </td>
<td>
<img src="images/NSX3_03_02.jpg" width="792" height="130" alt=""></td>
<td rowspan="3" width="57" height=100% bgcolor="#000000">            </td>
</tr>
<tr>
<td width="792" height="791" valign=top>
<table width="100%" height="100%" border="0" cellpadding="25" cellspacing="0" align=left><tr><td valign=top align=left>add text
</td></tr></table>
</td>
</tr>
<tr>
<td>
<img src="images/NSX25_03.jpg" width="792" height="87" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>


----------



## neonjuice (Dec 26, 2008)

Hi CStuart.

Great to see that you are learning some programming. Although I think for this situation, CSS would be best. Using HTML tables is not advised and is old school. That is alot of   that you have utilized. Here is a quick snippet of what you are trying to do would look like in CSS with HTML.


```
<style="text/css">

body{
   background-color:#FFFFFF;
       }

#leftbar{
     background-color:#FFFFFF;
     float:left;
     width:400px;
     
         }

#right-bar{
          margin:0 0 0 35%;
	  width:595px;
	  background-color:#FFFFFF;
	  border-color:#000000;
	  border-style:solid;
	  border-width:medium;
          text-align:justified;
          font-size:12px;       (You can set many values to text)
          font-family:arial;
          padding-left:0.2%;
          padding-top:0.3%;  ( using several paddings to give you an idea )
          padding-right:0.2%;
	  }
</style>

Div containers go within the <body> Tags

<div id="leftbar"></div
<div id="right-bar"></div>
```
This was just a very quick bit of code, to give you a general idea of CSS with HTML. 
With CSS you can set all the sizes,colors,styles you may need and then just use the <div id> attribute in your HTML body to set the HTML infor within the laid out CSS styles. I think you should learn CSS as it is far more flexible and superior to using Tables for layouts. With CSS you can set exact values for how you wish your text to be like. Also notice how I set a width value but not a height value. Height is automatic for what you put within the division. Say you put in a 300px image in height, then the height will be only 300px high. You can set a specific height valued if required. Check out the W3C tutorials on CSS.


----------

