www.webdeveloper.com
Results 1 to 4 of 4

Thread: Width of A Table

  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Width of A Table

    Hello. I am kind of a HTML newbie but I am creating a table with information. If i do not specify the width of the table, it makes it very long and I have to scroll horizontally on the page to see it all. I want to be able to shrink it down and make it viewable on one page. How can I do this? Can I make the font smaller or specify a width of the table? I did <table width="400" border="1"> but this didnt change anything. Help please.

  2. #2
    Join Date
    Jun 2005
    Posts
    15
    This code will strech the table to fill the width of the screen.

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table>

  3. #3
    Join Date
    Mar 2003
    Location
    The Lone Star State
    Posts
    1,126
    The best way to do it would be via css.
    <style type="text/css">
    table{width:100%}
    </style>

  4. #4
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    The only reason a table would go wider than the screen is if the contents of the table are too wide.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles