Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixed width tables

Status
Not open for further replies.

Sam577

Technical User
Joined
Sep 2, 2003
Messages
168
Location
GB

Hi,

I'm using tables for layout in a DW MX 2004 template, and am trying to create a table that doesn't change width when text is entered into it (a fixed width table).

I've tried to enter pixel value widths (as opposed to %) in the Properties palette, but when I enter a lot of text into the table, the width still expands.

Can anyone help?

Many thanks
Sam
 
Enter a width for your table then set the width of each column in the first table row, ensuring that they add up to the total for the table. Like this
Code:
<table width="700" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td width="294">Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah</td>
 <td width="406">&nbsp;</td>
 </tr>
 <tr>
 <td>&nbsp;</td>
 <td>Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah BlahBlah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah</td>
 </tr>
</table>

[Peace][Pipe]
 

Thanks for that. The table I'm working with has a few columns and rows so is confusing. Can you help with the following code -- which values should I change? I need the cell with words "Put content here" not to increase in width when text is entered.

Many thanks
Sam


<table width="700" table border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="112" rowspan="3" valign="top" class="swotText"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="36" rowspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="673" rowspan="2" valign="top"><table width="673" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="100%" height="34" valign="top" class="title"><!-- TemplateBeginEditable name="Title" -->Type
Title Here<!-- TemplateEndEditable --></td>
<td width="15">&nbsp;</td>
</tr>
<tr> <!-- TemplateBeginEditable name="content" -->
<td height="427" valign="top"><p>Put content here</p>
</td>
<td width="15">&nbsp;</td>
<!-- TemplateEndEditable --></tr>
<tr>
<td height="1" valign="top"></td>
<td width="15" valign="top"><img src="../images/spacer.gif" alt="" width="14" height="1"></td>
</tr>
</table></td>
<td height="442" colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="21"></td>
</tr>
<tr>
<td width="140" height="19"></td>
<td width="4"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td></td>
</tr>
<tr>
<td height="74"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="0"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="1"><img src="../images/spacer.gif" alt="" width="112" height="1"></td>
<td><img src="../images/spacer.gif" alt="" width="36" height="1"></td>
<td></td>
<td><img src="../images/spacer.gif" alt="" width="140" height="1"></td>
<td><img src="../images/spacer.gif" alt="" width="2" height="1"></td>
<td><img src="../images/spacer.gif" alt="" width="1" height="1"></td>
</tr>
</table>
 
Not raelly sure what you are after here, but I have restricted the width of the content cell so that the page will now scroll. I have also added a space to all empty cells and shown the border just to demonstrate how complicated your table actually is. It might be worth looking at revising this.
Code:
<table width="700" table border="1" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr> 
    <td width="112" rowspan="3" valign="top" class="swotText"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="36" rowspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="673" rowspan="2" valign="top"><table width="673" border="1" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr> 
          <td width="100%" height="34" valign="top" class="title"><!-- TemplateBeginEditable name="Title" -->Type 
            Title Here<!-- TemplateEndEditable --></td>
          <td width="15">&nbsp;</td>
        </tr>
        <tr> <!-- TemplateBeginEditable name="content" --> 
          <td width="673" height="427" valign="top"><p>Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here Put content here Put content here Put content
              here Put content here </p>
          </td>
          <td width="15">&nbsp;</td>
        <!-- TemplateEndEditable --></tr>
        <tr> 
          <td height="1" valign="top">&nbsp;</td>
          <td width="15" valign="top"><img src="../images/spacer.gif" alt="" width="14" height="1"></td>
        </tr>
      </table></td>
    <td height="442" colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="21">&nbsp;</td>
  </tr>
  <tr> 
    <td width="140" height="19">&nbsp;</td>
    <td width="4"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td height="74">&nbsp; </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td height="0">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td height="1"><img src="../images/spacer.gif" alt="" width="112" height="1"></td>
    <td><img src="../images/spacer.gif" alt="" width="36" height="1"></td>
    <td>&nbsp;</td>
    <td><img src="../images/spacer.gif" alt="" width="140" height="1"></td>
    <td><img src="../images/spacer.gif" alt="" width="2" height="1"></td>
    <td><img src="../images/spacer.gif" alt="" width="1" height="1"></td>
  </tr>
</table>

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top