bestbuildpc: Forums
 

Center-align a HTML table
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 167
Location: NL

PostPosted: Thu Nov 27, 2014 11:06    Post subject: Center-align a HTML table Reply with quote

Since align attribute is obsolete and unneeded for pages operating in standards-compliant mode I show you an example how it should be change

Code:
echo '<table align="center"><tr><td><span class="option">' , _DL_CATEGORY , ': ' , $title , '</span></td></tr></table>';


Replace with

Code:
echo '<table style="margin: 0px auto;"><tr><td><span class="option">' , _DL_CATEGORY , ': ' , $title , '</span></td></tr></table>';


or

Code:
echo '<div align="center">';


replace with

Code:
echo '<div style="margin: 0px auto;">';


or

In your style.css file you would have something like this:

Code:
.centerTable { margin: 0px auto; }


Then use class

Code:
echo '<table class="centerTable"><tr><td><span class="option">' , _DL_CATEGORY , ': ' , $title , '</span></td></tr></table>';


That's all folks!
Back to top
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials All times are GMT + 2 Hours
 
 Page 1 of 1

 

 Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

 
Forums ©