/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@Rick_BullNov 24.2002 — You could try using padding:

<i>
</i>&lt;td style="padding:1em;"&gt;


Which would add 1em's worth of padding to all sides of the cell.
Copy linkTweet thisAlerts:
@StefanNov 24.2002 — [i]Originally posted by Waves [/i]

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


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.
Copy linkTweet thisAlerts:
@PeOfEoNov 24.2002 — 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
Copy linkTweet thisAlerts:
@DUMD-DODec 24.2002 — 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?
×

Success!

Help @Waves 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...