How to make rounded tables
phpBB 3.0 BETA/RC subSilver2 is similar to phpBB 2.0, so there is no point in making separate tutorial for it. phpBB 3.0 final will have different default style with completely different code, and I'll add tutorial for it when phpBB 3.0 final will be released.
vBulletin has a very nifty feature: replacements. You can use it to minimize code used for header.
Currently our header code is this:
vBulletin
Next is vBulletin. For this example I'll modify same table as I modified in phpBB example: who's online section of forum index.vBulletin has a very nifty feature: replacements. You can use it to minimize code used for header.
Currently our header code is this:
Code:
- <table border="0" cellspacing="0" cellpadding="0" border="0" width="100%">
- <tr>
- <td width="26" align="left"><img src="images/corner_left.gif" width="26" height="28" border="0" alt="" /></td>
- <td width="100%" align="left">Table Header</td>
- <td width="6" align="right"><img src="images/corner_right.gif" width="6" height="28" border="0" alt="" /></td>
- </tr>
- </table>
Split it in two parts: before middle table cell and after that table cell. Make two replacements: <hdr>:
Code: (<hdr>)
- <table border="0" cellspacing="0" cellpadding="0" border="0" width="100%">
- <tr>
- <td width="26" align="left"><img src="images/corner_left.gif" width="26" height="28" border="0" alt="" /></td>
and </hdr>:
Code: (</hdr>)
- <td width="6" align="right"><img src="images/corner_right.gif" width="6" height="28" border="0" alt="" /></td>
- </tr>
- </table>
Now header code is much simplier and it looks like this:
Code:
- <hdr>
- <td width="100%" align="left">Table Header</td>
- </hdr>
Open template "forumhome", find who's online table:
Code:
- <!-- what's going on box -->
- <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
- <thead>
- <tr>
- <td class="tcat" colspan="2">$vbphrase[whats_going_on]</td>
- </tr>
- </thead>
- <if condition="$show['loggedinusers']">
- <!-- logged-in users -->
- <tbody>
- <tr>
- <td class="thead" colspan="2">
- <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
- <a href="online.php$session[sessionurl_q]" rel="nofollow">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
- </td>
- </tr>
- </tbody>
- ...
This is just a beginning of that table, real code is much longer. We'll change first table row to header, as it contains text that is suitable for rounded header. In code above I've highlighted lines that will be changed. Move those lines before <table>, remove <thead>, <tr>, </tr> and </thead> from it:
Code:
- <!-- what's going on box -->
- <td class="tcat" colspan="2">$vbphrase[whats_going_on]</td>
- <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
- <if condition="$show['loggedinusers']">
- <!-- logged-in users -->
- <tbody>
- <tr>
- <td class="thead" colspan="2">
- <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
- <a href="online.php$session[sessionurl_q]" rel="nofollow">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
- </td>
- </tr>
- </tbody>
Add our replacements <hdr> and </hdr> before and after table cell that we moved outside of table:
Code:
- <!-- what's going on box -->
- <hdr>
- <td class="tcat" colspan="2">$vbphrase[whats_going_on]</td>
- </hdr>
- <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
- <if condition="$show['loggedinusers']">
- <!-- logged-in users -->
- <tbody>
- <tr>
- <td class="thead" colspan="2">
- <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
- <a href="online.php$session[sessionurl_q]" rel="nofollow">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
- </td>
- </tr>
- </tbody>
That's all.
If you repeat last steps for all other tables you'll create a good looking hi-tech template.
If you repeat last steps for all other tables you'll create a good looking hi-tech template.