TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Table align question

Started by dimdom, October 03, 2009, 01:35:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dimdom

I am trying to merge two different php scripts to work in one block.

I have managed to make it but I have stucked in a (probably) simple thing...

I can not make the second table be aligned at the top as the fist one does. See attached images.

The code follows:

echo '
<table>
   <tr>
       <td>';
       

       
//RECENT TOPICS BLOCK


global $scripturl;
$what=ssi_recentTopics('5', NULL, 'array');

echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3"><td valign="middle"><font color="#4266BB"><b><font size="-2">ΝΕΑ ÃŽÅ"ÃŽâ€"ΝΥÎÅ"ΑΤΑ</font></b></font></td></tr>';

foreach ($what as $topic)
 {
 
   echo '<tr><td class="windowbg" valign="middle"><span class="smalltext">', $topic['link'];
   
     
'</span></td></tr>';
 }
 
echo '</table>';

echo '
       </td>
       <td>';
       

       
// RECENT DOWNLOADS BLOCK

global $db_prefix, $scripturl;
$cats = array();
$cat = implode(',',$cats);
$categories = '';

echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3"><td valign="middle"><font color="#4266BB"><b><font size="-2">ΝΕΑ ΑΡΧΕÎâ,,¢ÃŽâ€˜</font></b></font></td></tr>';

if(!empty($cats))
$categories = "AND f.ID_CAT IN($cat)";
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
$categories
ORDER BY f.ID_FILE DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {

echo '<table width="100%" cellpadding="2" cellspacing="0">
<td class="windowbg" valign="middle"><span class="smalltext"><a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></span></td>

<td class="windowbg" align="right"><span class="smalltext">',$row['totaldownloads'],'</a></span></td>
</tr>
</table>';
}
     

echo '
       </td>
   </tr>
</table>';


Any help will be greatly appreciated!

Freddy

You appear to have one table in another table - that's what is causing the problem.  I would try making the whole of the information appear in just one table - then whenever one cell is slightly bigger than another one all the other rows will expand to match it's size.

dimdom

#2
Thanks, freddy!

And how do I do that exactly?  8)

Freddy

Well I would learn some HTML  ;D ;)

Is this using the downloads mod you were saying about in the other tabbed block thread ?

If it is then can you drop me a link and I will download it now.

Then I can help better.

dimdom

#4
I am an amature, I know... :P

The mod is here: http://custom.simplemachines.org/mods/index.php?mod=992

If you look at this link in my site, youll see that I have managed ...half the proccess...

http://www.authorway.com/SMF/index.php?page=33

Ii is aligned vertically, after removing the

echo '
       </td>
       <td>';


code...


And here is the php file that I am working on that includes recent articles, recent topics and recent downloads (attached).

Freddy

Thanks :)

OK so just let me get this right - you want all three things to align up side by side in one block or article ?  Rather than vertically ?

dimdom

Yes, like the pictures in my first post...

And if  possible, I would all three blocks to have the same icon at the left of every title (like the recent articles block).

I want a lot, i know few... :laugh:

Freddy

OK leave it with me for a bit.  I need to figure out how this new downloads mod works.   Maybe you can help me - how do I add a category ?  I can't seem to find out how to do it.

dimdom

downloads first page, at the bottom.

Freddy


This website is proudly hosted on Crocweb Cloud Website Hosting.