Need help with Tables

U

Ulle

Hi there :)
I could use a little help with a table problem.

If you go here : http://bf1942.sega-star.com/player.php?id=2

then you see : Character Types,Weapons,Top Victims,Top Assasins,Favorite
Vehicles lined up under eachother very nice, but the problem is i want to
have Character Types & Weapons beside eachother but if im setting "left" &
"right" in thoose 2 in the code it all getting messy, then it all going in
to eachother, a real mess, so i would be happy if someone could tell me what
to do, the code is :

--------------------------
<tmpl_include file="head.html">
<table width="95%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=2>Player-Details</th>
</tr>
<tr class=light>
<th width=10%>Playername:</th>
<td><tmpl_var name="name"></td>
</tr>
<tr class=dark>
<th>Stats-ID:</th>
<td><tmpl_var name="id"></td>
</tr>
<tr class=light>
<th>KeyHash:</th>
<td><tmpl_var name="keyhash"></td>
</tr>
<tr class=dark>
<th>Last Seen:</th>
<td><tmpl_var name="last_seen"></td>
</tr>
<tr class=light>
<th>Rounds played:</th>
<td><tmpl_var name="rounds"></td>
</tr>
<tr class=dark>
<th width=10%>Logged since:</th>
<td><tmpl_var name="date"></td>
</tr>
<tr class=light>
<th width=10%>Total Score:</th>
<td><tmpl_var name="score"></td>
</tr>
<tr class=dark>
<th width=10%>Total Kills:</th>
<td><tmpl_var name="kills"></td>
</tr>
<tr class=light>
<th width=10%>Total Deaths:</th>
<td><tmpl_var name="deaths"><img src="{tmpl_var
name='IMAGES_DIR'}icon_deaths.gif" align=absmiddle hspace=2></td>
</tr>
<tr class=dark>
<th width=10%>Total TKs:</th>
<td><tmpl_var name="tks"></td>
</tr>
<tr class=light>
<th width=10%>Awards:</th>
<td><tmpl_var name="awards" escape=none></td>
</tr>
<tr class=dark>
<th>Heals:</th>
<td><tmpl_var name="name"> spent <tmpl_var name="otherheals_time"> on
healing <tmpl_var name="otherheals_amount"> Heal-Points to other
Players<br></td>
</tr>
<tr class=light>
<th><img src="{tmpl_var name='IMAGES_DIR'}icon_heals.gif"
align=absmiddle hspace=2></th>
<td><tmpl_var name="name"> spent <tmpl_var name="selfheals_time"> on
healing <tmpl_var name="selfheals_amount"> Heal-Points to himself</td>
</tr>
<tr class=dark>
<th>Repairs:</th>
<td><tmpl_var name="name"> spent <tmpl_var name="repairs_time"> on
repairing <tmpl_var name="repairs_amount"> Repair-Points</td>
</tr>
<tr class=light>
<th><img src="{tmpl_var name='IMAGES_DIR'}icon_repairs.gif"
align=absmiddle hspace=2></th>
<td></td>
</tr>
</table>
<p>
<table width="95%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Nicknames</th>
</tr>
<tr class=head>
<th>#</th>
<th>Nickname</th>
<th>Usage</th>
<th>&nbsp;</th>
</tr>
<tmpl_loop name="nicknames">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><tmpl_var name="nickname"></td>
<td class=number><tmpl_var name="count"></td>
<td><tmpl_var name="bar" escape="none"></td>
</tr>
</tmpl_loop>
</table>
<p>
<table width="40%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Character Types</th>
</tr>
<tr class=head>
<th>#</th>
<th>Character Type</th>
<th>Usage</th>
</tr>
<tmpl_loop name="charactertypes">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><tmpl_var name="kit">&nbsp;<img src="{tmpl_var name="modimg"}"
align=absmiddle></td>
<td class=number><tmpl_var name="count"></td>
</tr>
</tmpl_loop>
</table>
<p>
<tmpl_if name="weaponusage">
<table width="40%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Weapons</th>
</tr>
<tr class=head>
<th>#</th>
<th>Weapon</th>
<th>Kills</th>
<th>%</th>
</tr>
<tmpl_loop name="weaponusage">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><tmpl_var name="weapon"></td>
<td class=number><tmpl_var name="count"></td>
<td class=number><tmpl_var name="percentage"></td>
</tr>
</tmpl_loop>
</table>
<p>
</tmpl_if>
<tmpl_if name="topvictims">
<table width="40%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Top Victims</th>
</tr>
<tr class=head>
<th>#</th>
<th>Player</th>
<th>Kills</th>
<th>%</th>
</tr>
<tmpl_loop name="topvictims">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><img src="{tmpl_var name="playerimg"}" align=absmiddle hspace=2><a
href="{tmpl_var name="playerdetaillink"}"><tmpl_var name="name"></a></td>
<td class=number><tmpl_var name="count"></td>
<td class=number><tmpl_var name="percentage"></td>
</tr>
</tmpl_loop>
</table>
<p>
</tmpl_if>
<tmpl_if name="topassasins">
<table width="40%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Top Assasins</th>
</tr>
<tr class=head>
<th class=number>#</th>
<th>Player</th>
<th class=number>Kills</th>
<th class=number>%</th>
</tr>
<tmpl_loop name="topassasins">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><img src="{tmpl_var name="playerimg"}" align=absmiddle hspace=2><a
href="{tmpl_var name="playerdetaillink"}"><tmpl_var name="name"></a></td>
<td class=number><tmpl_var name="count"></td>
<td class=number><tmpl_var name="percentage"></td>
</tr>
</tmpl_loop>
</table>
<p>
</tmpl_if>
<table width="40%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Favorite Vehicles</th>
</tr>
<tr class=head>
<th class=number>#</th>
<th>Vehicle</th>
<th class=number>Time</th>
<th class=number>%</th>
</tr>
<tmpl_loop name="favvehicles">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><tmpl_var name="vehicle"></td>
<td class=number><tmpl_var name="time"><img src="{tmpl_var
name='IMAGES_DIR'}icon_clock.gif" align=absmiddle hspace=2></td>
<td class=number><tmpl_var name="percentage"></td>
</tr>
</tmpl_loop>
</table>
<p>
<table width="95%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Map Performance</th>
</tr>
<tr class=head>
<th class=number>#</th>
<th>Map</th>
<th class=number>Score</th>
<th class=number>%</th>
<th>&nbsp;</th>
</tr>
<tmpl_loop name="mapperformance">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><a href="{tmpl_var name='mapdetaillink'}"><img src="{tmpl_var
name='IMAGES_DIR'}icon_map.gif" align=absmiddle hspace=2><tmpl_var
name="map"></a></td>
<td class=number><tmpl_var name="score"></td>
<td class=number><tmpl_var name="percentage"></td>
<td><tmpl_var name="bar" escape="none"></td>
</tr>
</tmpl_loop>
</table>
<p>
<table width="95%" border="1" align="center">
<tr class="head">
<th colspan="8" class="super" scope="col">Last Games<a
name="games">&nbsp;</a></th>
</tr>
<tr class=head>
<th>Game started</th>
<th>Server Name</th>
<th>Mod</th>
<th>Map</th>
<th>GameMode</th>
<th>Score</th>
<th>Kills</th>
<th>Deaths</th>
</tr>
<tmpl_loop name="games">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td><tmpl_var name="date"></td>
<td><img src="{tmpl_var name='IMAGES_DIR'}joystick_icon.gif"
align=absmiddle hspace="2"><a href="{tmpl_var
name="gamedetaillink"}"><tmpl_var name="servername"></a></td>
<td><tmpl_var name="mod"><img src="{tmpl_var name='modimg'}"
align=absmiddle hspace="2"></td>
<td><tmpl_var name="map"></td>
<td><tmpl_var name="game_mode"></td>
<td><tmpl_var name="score"></td>
<td><tmpl_var name="kills"></td>
<td><tmpl_var name="deaths"></td>
</tr>
</tmpl_loop>
</table>
<tmpl_include file="foot.html">
 
N

Neredbojias

To further the education of mankind said:
Hi there :)
I could use a little help with a table problem.

If you go here : http://bf1942.sega-star.com/player.php?id=2

then you see : Character Types,Weapons,Top Victims,Top
Assasins,Favorite Vehicles lined up under eachother very nice, but the
problem is i want to have Character Types & Weapons beside eachother
but if im setting "left" & "right" in thoose 2 in the code it all
getting messy, then it all going in to eachother, a real mess, so i
would be happy if someone could tell me what to do, the code is :
<snip>

I fell asleep reading your code but it sounds like you need to put
'Character Types' and 'Weapons' in 2 cells of the same row and use
'colspan="2"' in all the single-cell rows below it.
 
A

Andy Dingley

Ulle said:
then you see : Character Types,Weapons,Top Victims,Top Assasins,Favorite
Vehicles lined up under eachother very nice, but the problem is i want to
have Character Types & Weapons beside eachother but if im setting "left" &
"right" in thoose 2 in the code it all getting messy,

<tmpl_var name="name"> isn't HTML, so I guess you're using some sort of
templated CMS.

Learn some CSS, use that to set alignment, get the CMS to set the
classes on the <td> elements.
 
U

Ulle

I did cut in the code so its only this code i need beside eachother :

Best Regards
Ulle
--------------------------------------------------------
<table width="40%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Character Types</th>
</tr>
<tr class=head>
<th>#</th>
<th>Character Type</th>
<th>Usage</th>
</tr>
<tmpl_loop name="charactertypes">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><tmpl_var name="kit">&nbsp;<img src="{tmpl_var name="modimg"}"
align=absmiddle></td>
<td class=number><tmpl_var name="count"></td>
</tr>
</tmpl_loop>
</table>
<p>
<tmpl_if name="weaponusage">
<table width="95%" border="1" align="center">
<tr class="head">
<th class="super" scope="col" colspan=5>Weapons</th>
</tr>
<tr class=head>
<th>#</th>
<th>Weapon</th>
<th>Kills</th>
<th>%</th>
</tr>
<tmpl_loop name="weaponusage">
<tmpl_if name="__EVEN__">
<tr class="light">
<tmpl_else>
<tr class="dark">
</tmpl_if>
<td class=number><tmpl_var name="__ROWNUM__"></td>
<td><tmpl_var name="weapon"></td>
<td class=number><tmpl_var name="count"></td>
<td class=number><tmpl_var name="percentage"></td>
</tr>
</tmpl_loop>
</table>
</tmpl_if>
<p>
-----------------------------
 
J

Jim Moe

Ulle said:
If you go here : http://bf1942.sega-star.com/player.php?id=2
then you see : Character Types,Weapons,Top Victims,Top Assasins,Favorite
Vehicles lined up under eachother very nice, but the problem is i want to
have Character Types & Weapons beside eachother but if im setting "left" &
"right" in thoose 2 in the code it all getting messy, then it all going in
to eachother, a real mess, so i would be happy if someone could tell me what
to do, the code is :
Because the coding style is so antiquated (not even a DTD!), you could
just put those tables in another table.
For more flexibility you could float:left the smaller tables so they
line up horizontally, space permitting.
<tmpl_include file="head.html">
All of your code is useless and a waste of bandwidth because of lines
like the above.
 
U

Ulle

Yeah, i know its old, but the problem is im a total n00b to html....
But table in table ?
Should i just type <table> at top, and </table> in the botom?

Im sorry, but i dont understand html code very good..:(

Best Regards
Ulle
 
J

Jim Moe

Ulle said:
Yeah, i know its old, but the problem is im a total n00b to html....
But table in table ?
Should i just type <table> at top, and </table> in the botom?
Tables may be nested inside other tables, in a <td>. All the parts are
<tr> said:
Im sorry, but i dont understand html code very good..:(
Then we probably cannot help you very much.
Take some tutorials on HTML. Then other tutorials on CSS (Cascading
StyleSheets).
 
M

Michael Laplante

Ulle said:
Yeah, i know its old, but the problem is im a total n00b to html....
But table in table ?
Should i just type <table> at top, and </table> in the botom?

Im sorry, but i dont understand html code very good..:(

Get a buddy who knows HTML to help you -- it will be quicker than trying to
do it yourself right now. If you want to learn a little HTML (or a lot)
these sites make it easy to learn in small bites.

http://www.htmldog.com/
http://www.bravenet.com/resourcecenter/tutorials/index.php

M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top