HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
2 Special Questions
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
krisimp



Joined: 27 Oct 2009
Posts: 3

PostPosted: Tue Oct 27, 2009 1:27 pm     2 Special Questions Reply with quote

Hello,

i got 2 Problems with this Code:
Code:
<div class="cBlock1">
<table border="0" cellpadding="1" cellspacing="1" width="100%" class="infTable">
<tr>
<td nowrap class="infTitle" colspan="2"><a href="$ENTRY_URL$">$TITLE$</a>
<span title="Comments">(<a href="$COMMENTS_URL$"><b>$COMMENTS_NUM$</b></a>)</span>
<td nowrap align="center" width="50%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="75%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td>
<td nowrap align="right" width="100%" style="font:7pt"><font color="#646464">[$DATE$]</font></td></tr>
<tr>
<td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$">$MESSAGE$</a><?endif?></td></tr> </td></table></div>


1st. This
Code:
<td nowrap align="center" width="50%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="75%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td>

i need to be displyed in the Center of the Complete Tablerow, but actually its Place is dertermined by the size of the $TITLE$ Text.

2nd.
Code:
<td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$">$MESSAGE$</a><?endif?></td></tr> </td></table></div>
[/code]
I need the ability to decide the MaxLength of the $MESSAGE$ like when it Exceede 100 Charackters, skip all text behind and write ... instead.

Hope you can help me with this Smile
nikki



Joined: 24 Nov 2008
Posts: 132

PostPosted: Wed Oct 28, 2009 3:55 pm     Re: 2 Special Questions Reply with quote

krisimp wrote:


2nd.
Code:
<td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$">$MESSAGE$</a><?endif?></td></tr> </td></table></div>
[/code]
I need the ability to decide the MaxLength of the $MESSAGE$ like when it Exceede 100 Charackters, skip all text behind and write ... instead.


You can use javascript to show first few character of the message

Code:
function limitLength(){
      var element = document.getElementById("message");
      element.innerHTML = element.innerHTML.substring(0, 100)
      element.innerHTML = element.innerHTML + "......";
   }


add attribute "id" to the anchor tag

Code:
<a href="$ENTRY_URL$" id = "message">
nikki



Joined: 24 Nov 2008
Posts: 132

PostPosted: Wed Oct 28, 2009 4:06 pm     Re: 2 Special Questions Reply with quote

krisimp wrote:


1st. This
Code:
<td nowrap align="center" width="50%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="75%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td>

i need to be displyed in the Center of the Complete Tablerow, but actually its Place is dertermined by the size of the $TITLE$ Text.


Hope this helps


Code:
<div class="cBlock1">
   <table border="1" cellpadding="1" cellspacing="1" width="100%" class="infTable">
      <tr>
         <td nowrap class="infTitle" colspan="2" width = "40%"><a href="$ENTRY_URL$">$TITLE$</a>
            <span title="Comments">(<a href="$COMMENTS_URL$"><b>$COMMENTS_NUM$</b></a>)</span>
         </td>
         <td nowrap align="center" width="20%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
         <td nowrap align="center" width="20%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td>
         <td nowrap align="right" width="20%" style="font:7pt"><font color="#646464">[$DATE$]</font></td>
      </tr>
      <tr>
         <td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$" id = "message">$MESSAGE$ </a><?endif?></td>
      </tr>
   </table>
</div>
krisimp



Joined: 27 Oct 2009
Posts: 3

PostPosted: Thu Oct 29, 2009 10:23 am     Reply with quote

Thanks for your great Help!

Your Solution for my first Problem works nice. But only as long as the $MESSAGE$ isn't longer as then 40% else not. The $MESSAGE$ is supossed to be 100%.

Also i can't get the Javascript to work :/ i have added
Code:
<a href="$ENTRY_URL$" id = "dlmessage">$MESSAGE$ </a>

to the Anchor and
Code:
<script language="javascript">
function limitLength(){
      var element = document.getElementById("dlmessage");
      element.innerHTML = element.innerHTML.substring(0, 50)
      element.innerHTML = element.innerHTML + "......";
   }
</script>

to the Head or Body, also tried it in CSS but it's not working. (probably im to stupid)
nikki



Joined: 24 Nov 2008
Posts: 132

PostPosted: Thu Nov 05, 2009 2:30 pm     Reply with quote

Which browser are you using ?
krisimp



Joined: 27 Oct 2009
Posts: 3

PostPosted: Sun Nov 08, 2009 12:49 am     Reply with quote

Firefox 2
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial