tags:

views:

72

answers:

3

so i have a table... to sweeten things up, lets say i have this:

    <table style="border: apx #FF0000 solid; width: 1%;">  
  < tr>
    < td>a< /td>
  < /tr>
< /table>

they all have a space at the bigging so it will show, in the normal code it does not have the spaces

the table i am doing it different, but it made in php, and i this is just a repleca of the proplem

so, i want to add some text after the "A" it keeps on putting it on a new line,

a working example is here: http://www.walsallramblers.co.uk/

right hand side, calend,er red is on a new line, how do i spot this?, r does anyone know a better way of putting a red box around a word?

+2  A: 

Try this:

<span style="border:1px solid red;">Your text goes here</span>

You should only use tables to represent data in a table :)

Edit:

By the way, when you set "width: 1%" you are setting the width of the table, not the border. I think that's the reason it's breaking to a new line.

Sergio
old-school tables always generate line breaks before and after I believe, that's why CSS has `inline-table`
beggs
yes, thanks, this is what i was looking for, also, i know the width defines how big the box is, but if i set it to 1, it wraps around my text, and perfect,m this is just what i was looking for :), i looked for this first, but never got anywhere :)
A: 

Why do you set the width 1%? I think that's why you always get new lines..

A: 
<TR>
<TD COLSPAN='7' ALIGN=center>
<B>
<table style='white-space:nowrap; border: 1px #FF0000 solid; width: 20%;'>
     <tr><td>Red</td></tr>
</table> = Today , 
<font color='blue'>Blue</font> = Walk</B>
</TD>
</TR>

This is what you have at the site. I'm not totally clear why you want it set up that way, but your initial problem is that you have a table inside of a table cell. I wouldn't reccomend fixing the problem so much as starting over with more valid HTML. But I'm pretty sure that this would get you started on what you want:

<tr>
<b>
<td COLSPAN='7' style='white-space:nowrap; border: 1px #FF0000 solid; width: 20%;'>
Red
</td> = Today ,
<td> 
<font color='blue'>Blue</font> = Walk
</td>
</b>
</tr>

But that feels dirty just writing out. You should use something better. Off the top of my head, I'd go with:

<tr style="font-weight: bold;">
<td colspan="7" style='white-space:nowrap; border: 1px #FF0000 solid;'>
<span syle="color: red;">Red</span> = Today, <span syle="color: blue;">Blue</span> = Walk
</td>
</tr>
Anthony