/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@markdamoJun 06.2005 — 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>
Copy linkTweet thisAlerts:
@soccer362001Jun 06.2005 — The best way to do it would be via css.

<style type="text/css">

table{width:100%}

</style>
Copy linkTweet thisAlerts:
@felgallJun 06.2005 — The only reason a table would go wider than the screen is if the contents of the table are too wide.
×

Success!

Help @ral 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,
)...