How to force table cell to a certain width?

css Egypt
  • 13 years ago

      Hello, i have made a table that has two rows, the second row has one cell which contains dynamic conents generated in asp .net, the first row has three columns:

    - the centered one contains the table title and background image

    - the left has a background image that for the left edge and so the right cell

    the left and the right background images have with =9px so i changed the width in my style sheet page of the two cells to 9px and left the middle cell to auto

    unfortunetly the size of the two cells (left and right are not 9px) how to force the width of them to 9?

  • 13 years ago

    this is the table html code:

    <table border="0" width=100% cellspacing="0" cellpadding="0" id="table1">
     <tr>
      <td class="left" ></td>
      <td class="center" >TITLE</td>
      <td class="right" ></td>
     </tr>
     <tr>
      <td colspan="3">Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed
      Ahmed Ahmed Ahmed Ahmed Ahmed Ahmed </td>
     </tr>
    </table>
























     

    and this is the style code:

    <style>
    .left{
    background: url('http://img294.imageshack.us/img294/9014/smallheaderleftdr6.gif'); width:9px;
    }
    .right
    {
    background: url('http://img294.imageshack.us/img294/6783/smallheaderrightmq2.gif'); width:9px
    }
    .center
    {
    background: url('http://img150.imageshack.us/img150/4071/smallheadercenterun4.gif');
    }










    </style>

     

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr