/    Sign up×
Community /Pin to ProfileBookmark

i have a table within a div
the div is set to width:700px
the problem is the table exceeds the width of the div
so how can i keep it inside the div?

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@CFHuttonDec 03.2009 — Lots of possible answers to your question, but a little more info would be helpful to narrow down the possible options.

The obvious answers:

  • 1. Make the table smaller.

  • 2. Make the div larger.


  • Since one can assume those aren't sufficient, you might could consider using a 'thumbnail' size picture of the table that has a 'click to enlarge' link below it, which, when clicked, opens a 'lightbox' type popup to display the table at full size.

    Also, the overflow property can be used to make the div scrollable, but that rarely seems like a good answer...

    cfh
    Copy linkTweet thisAlerts:
    @robertbarzykauthorDec 03.2009 — well there is more to the problem which i forgot to state before

    the table is coming from php

    this isnt the actual code but just an example

    echo "<table>";

    $num=1;

    echo "<tr><td>";

    while($num<100){ echo '<img src="image.jpg" height="75px" width="75px">';

    $i++

    }

    echo "</table>"; ?>


    what i want to do is after the while loop executed 9 times i want it to go to the next line.
    Copy linkTweet thisAlerts:
    @CFHuttonDec 04.2009 — I'd suggest trying the php forum. I might could cobble something together but without the ability to test it, it would be an embarrassing display ?

    cfh
    ×

    Success!

    Help @robertbarzyk spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...