Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Location
    Pakistan
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to fix the width of table?

    hi all
    how to fix the width of table.
    i mean to say that if i set the width of table as 20% or 480px and if i enter more values then the table's right side increases.

    Regards,
    Aamir
    God helps those who help others.

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    375
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The idea is not to put more content in the table than can fit. What do you want to happen to the content that extends beyond the boundary? Anyways, the css property you would be dealing with is overflow. Tables do not respond real well to overflow. You can however, nest the table in a division:
    Code:
    <div style="overflow:hidden;width:300px">
    <table>
    <tr>
        <td><img src=1st.jpg></td>
    </tr>
    </table>
    </div>
    The above table will never appear wider than 300px. Anything in it that lies beyond its 300px x-offset will be invisible. You can use 'overflow:scroll' then a scrollbar will appear to allow viewing of the clipped material (if any).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •