Center all items on table?

Go down

Center all items on table?

Post by cclloyd9785 on June 24th 2010, 12:14 am

Is there a way to center all items on a table other than add the center tags into each individule cell?
avatar
cclloyd9785
Forumember

Male Posts : 444
Reputation : 3
Language : Whatever you speak
Location : woaclan.tk

http://woaclan.forumotion.net/

Back to top Go down

Re: Center all items on table?

Post by RoNo on June 24th 2010, 2:15 am

Here are a couple examples of centering...

Using Css to create style/class for the table
(table1 will be the table class)
Code:
<style text/css">
.table1 {
margin-left: auto;
margin-right: auto;
text-align: center;
}</style>

<table class="table1" border="2" cellpadding="2" cellspacing="2" width="400">
<tr>
<td width="250">Left Table Cell Content</td>
<td width="600">Right Table Cell Content.</td>
</tr>
</table>




Outer table that is centered on the page...
with an inner table that has centered content
Code:
<table style="margin-left:auto;margin-right:auto"><tr>
<td>

<table style="text-align:center"><tr>

<td>Stuff in here</td>

</tr>
<tr>

<td>More stuff in here</td>

</tr>
<tr>

<td>And more stuff in here</td>

</tr>
<tr>

<td>All centered</td>

</tr>
</tr>
</table>

</td>
</tr></table>
avatar
RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

Re: Center all items on table?

Post by cclloyd9785 on June 24th 2010, 5:50 am

I just took the BB code from a post, and put it into a portal widget so it would turn it into HTML for me. It isnt centered. Any ideas?
avatar
cclloyd9785
Forumember

Male Posts : 444
Reputation : 3
Language : Whatever you speak
Location : woaclan.tk

http://woaclan.forumotion.net/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum