Thread: Table width

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    31
    Rep Power
    2

    Table width


    I had to turn a term paper in to a website. For the references, it's a specific format of:
    Author:
    Title:
    Publisher:
    URL:

    And the URL needs to be typed out in full. Since most of the content doesn't take up that much space, I made a table with 3 columns, and a list inside each cell for the reference info. Since URLs are so long though, it's causing the cells to be really stretched out, and the table to go off the edge of the page.

    I tried setting the width of the table in CSS, but it still went off the page, same with the width of the cells (gave the table an id of ref_table, tried to set the width for #ref_table tb) but it doesn't change anything when viewing the page.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    31
    Rep Power
    2
    Firebug confirms the width of the table, and the cells, is set and being read (not crossed out), yet the long text still stretches it out. Is there any way around this??
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    show us your code or a link to your code so we can actually see what you are talking about.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    31
    Rep Power
    2
    For some reason it doesn't load properly on the school's server even though it does locally, but you can save the files from the links below.

    http://tiger.towson.edu/~tbaldw2/paper/references.html
    http://tiger.towson.edu/~tbaldw2/style.css
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    The issues of it not loading properly on school's server is because you are using a backslash (\) instead of a forward slash (/) to link your style.css file, which won't work on a webserver.

    As for your problem, I would get rid of the table and just use a DIV for #ref_table in place of the table. And since you have all of the table cells using an unordered list with a class of "references" just setup rules for that [width, height, floats] and put each reference on its own line instead of trying to fit 3 per row.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    31
    Rep Power
    2
    Oops, thanks :-)

    Yeah I was starting to think doing away with the table may be the way to go as well. When I started the three columns across it was before I knew I had to have the full URL (just had the title set as a link to the article, still seems much simpler that way to me haha, but professors can be picky...). Thanks for the advice

IMN logo majestic logo threadwatch logo seochat tools logo