Jump to content

question please..


vinsux
Go to solution Solved by vinsux,

Recommended Posts

hi there, i just wanna ask a question.. i'm making a poll using php right now..

 

may i ask if it's possible to set the width of a <td> in a table from the values from the database?..

 

also how can i count the total value of numbers in a database.

 

in my database, i have a number of votes from different names, how can i count them all? because i need it to get the percentage of the votes..

 

 

 

 

please help me thanks and god bless..

Link to comment
Share on other sites

Your question is a littlee confusing because the answer seems painfully obvious. If you have a value from the database, just set the width to what you want. I have no idea how you plan to set the width based upon the value from the database. Do you want the value to be set to the actual value from the database or calculated based on that DB value?

 

Also, you can set the value in the actual HTML or within the Style sheet.

 

 

<table style="width: <?php echo $valueFromDB; ?>px">
Edited by Psycho
Link to comment
Share on other sites

 

Your question is a littlee confusing because the answer seems painfully obvious. If you have a value from the database, just set the width to what you want. I have no idea how you plan to set the width based upon the value from the database. Do you want the value to be set to the actual value from the database or calculated based on that DB value?

 

Also, you can set the value in the actual HTML or within the Style sheet.

 

 

<table style="width: <?php echo $valueFromDB; ?>px">

 

^

that sample code is what i'm looking for, but i tried that code and it's not working...

 

sorry for my bad english..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.