www.webdeveloper.com
Results 1 to 5 of 5

Thread: Column Widths in Table

  1. #1
    Join Date
    Nov 2002
    Posts
    3

    Column Widths in Table

    Hello-
    I'm having difficulty with the column widths in my table.

    Specifically, I have a simple two-column table but even though I have the table centered (align="center"), the table columns (and the data within them) appears too far to the left.

    I have experimented with changing the width dimensions and that helps some, but the table data still appears too far to the left.

    Does anyone have any suggestions for how to adjust the width of the columns so that they appear centered in the page?

    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    You could try using padding:

    Code:
    <td style="padding:1em;">
    Which would add 1em's worth of padding to all sides of the cell.

  3. #3
    Join Date
    Nov 2002
    Posts
    984

    Re: Column Widths in Table

    Originally posted by Waves
    Does anyone have any suggestions for how to adjust the width of the columns so that they appear centered in the page?
    Do you have a link to the page so we can give usable suggestions?

    In general though, I'm hoping that you are using <table> to create a Table, not general page layout.
    For layout you should use CSS.

  4. #4
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    are you using <td align="center"><tr align="center"> of just <center> or div. Im not sure how much of a diffence make inbetween these methods but if you were just to say <table align="center"> It would put the table in the center of the page. Also if you look on the barbaric software site in my signiture The info that is at the bottum of the page off my main table is aligned to center or your screen when you first see the page not the actual center of the page because when you use the horizontal scroll it can exily become not so centerd. Ok I might Im starting to even confuse myself all I am trying to say is it really matters where you put the center.
    You can always throw some random &NBSP; 's in ur code

  5. #5
    Join Date
    Dec 2002
    Posts
    19

    aligning cell not tables

    Simple or not tables are ficklers for aligning.
    There a many tricks out there to assist with aligning tables but if al comes down to browser of the user in the end.

    <table width=640 cellpadding=0 cellspacing=0 border=0 bgcolor=mistyblue align=center>
    <tr>
    <td width=320 align=center>
    data data data data data
    </td>
    <td width=320 align=center>
    data data data data
    </td>
    </tr></table>

    I hope that helps you a little

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