FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Radio and text not going 100%?

 


Diablosblizz
This maybe hard to explain, so first off I will show a picture:



As you see, the "blue" image behind the text stops at the end of the text. I want it to go fully to the end of the "box."

If I put a width=100% into my table, it will put the text in the middle of the bar, which I don't want. Basically, I want to go from the image above to the image below:



Currently, my table looks like this (one part of the poll itself):


Code:
<tr>
             <td class="sectiontableentry1">
            <input type="radio" name="vote" value="opt2">

             </td>
         <td class="sectiontableentry1">
            <label for="voteid494">
               <?php echo $poll['opt2']; ?>
                                </label>
         </td>
   </tr>


Under sectiontableentry1, on the CSS, I have:

Code:
.sectiontableentry1 {
   background-color: #8EC0EB !important;
}


I have also tried putting width: 100%; in sectiontableentry1, but again no luck. Does anybody know how I can stretch the blue background to the end of the box that holds the poll?

Thanks, and I hope you understand!
AftershockVibe
Having not seen the rest of your CSS I can't tell but this is probably because the entire table does not have fixed width and as such if you enter text which doesn't fill all the way to the edge, the table width itself shrinks.

Now, because that causes the text to be central you should be able to set the text alignment to "left" to sort that out.
Diablosblizz
Before I reply, do I have to set the text alignment in the table or in the <td>?


EDIT:

I put it in the table cause I've tried the <TD> and nothing happens. Here is my code:

Code:
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="left">
                  
                     <tr>
                     <td class="sectiontableentry2" width="5%"><input type="radio" name="vote" id="opt1" value="opt1"></td>
                     <td class="sectiontableentry2" width="100">Test</td>
                     </tr>
                                    <tr>
                        <td class="sectiontableentry1">
                           <input type="radio" name="voteid" id="voteid494" value="opt2" alt="494" />

                        </td>
                        <td class="sectiontableentry1">
                           <label for="voteid494">
                              <?php echo $poll['opt2']; ?></label>
                        </td>
                     </tr>
                                    <tr>
                        <td class="sectiontableentry2">

                           <input type="radio" name="voteid" id="voteid495" value="opt3" alt="495" />
                        </td>
                        <td class="sectiontableentry2">
                           <label for="voteid495">
                              <?php echo $poll['opt3']; ?></label>
                        </td>
                     </tr>
                                    <tr>

                        <td class="sectiontableentry1" valign="top">
                           <input type="radio" name="voteid" id="voteid496" value="opt4" alt="496" />
                        </td>
                        <td class="sectiontableentry1">
                           <label for="voteid496">
                              <?php echo $poll['opt4']; ?></label>
                        </td>
                     </tr>

                                    <tr>
                        <td class="sectiontableentry2">
                           <input type="radio" name="voteid" id="voteid497" value="opt5" alt="497" />
                        </td>
                        <td class="sectiontableentry2"">
                           <label for="voteid497">
                              <?php echo $poll['opt5']; ?></label>
                        </td>

                     </tr>
                           </table>


I also tried style="text-align: left."
Diablosblizz
Bump.

Anybody know?
Ranfaroth
Why tables for layout is stupid...
Diablosblizz
What exactly is this website supposed to do for me?
Stubru Freak
He means that the problems you're having are caused by the strange behaviour of tables. You should avoid them.
But did you try setting "width: 100%;" and "text-align: left;"?
Diablosblizz
Yes I have.
Stubru Freak
Diablosblizz wrote:
Yes I have.


What happens?
Diablosblizz
The text would go into center, but I have fixed this. It was caused by the MySQL entries being too small, of course they won't be small but it was a test.

Thank you for your support guys!
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.