Connecting Tech Pros Worldwide Forums | Help | Site Map

[Q] table cell spanning whole page?

Sir Loin of Beef
Guest
 
Posts: n/a
#1: Jul 20 '05
I would like to create a table with a bar of text that spans the whole
page.

Here is what I have so far:

<table border=0 width="100%" >
<tr>
<td><img src="SANimages/magnify.gif"></td>
<td valign="top"><span
style="font-size:12px;font-weight:bold;color:#f1f1f1;
background:#484848;width:100%;text-align:left;">Search</span></td>
</tr>
</table>

Problem is, the bar of text seems to be right-aligned, and even with
the style being width:100%, it still doesn't span the entire table
cell it's in.

What am I doing wrong?

David Dorward
Guest
 
Posts: n/a
#2: Jul 20 '05

re: [Q] table cell spanning whole page?


Sir Loin of Beef wrote:
[color=blue]
> I would like to create a table with a bar of text that spans the whole
> page.
>
> Here is what I have so far:
>
> <table border=0 width="100%">
> <tr>
> <td><img src="SANimages/magnify.gif"></td>
> <td valign="top"><span
> style="font-size:12px;font-weight:bold;color:#f1f1f1;
> background:#484848;width:100%;text-align:left;">Search</span></td>
> </tr>
> </table>
>
> Problem is, the bar of text seems to be right-aligned, and even with
> the style being width:100%, it still doesn't span the entire table
> cell it's in.
>
> What am I doing wrong?[/color]

(1) It looks like you are trying to use tables for layout
(2) You don't have alt text on your image
(3) You are specifying the font size in pixels (are you trying to make it
impossible for people on high resolution systems, or with poor eyesight, to
read the content?)
(4) You are attempting to apply width to an inline element (span[1]), to
which it doesn't apply.

I think the problem you are perceiving is caused mainly by having two
columns without a width set on either. The real problem is your entire
approach.

[1] Which, as the only element inside the cell, is redundent anyway.

--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
Sir Loin of Beef
Guest
 
Posts: n/a
#3: Jul 20 '05

re: [Q] table cell spanning whole page?


So what should I do?

I'd like to have a single horizontal bar with 2 parts -
the left a small image, and the right, a bar of text spanning the
remainder of the column width. The image size may change later, so I
don't want to hardcode the image dimensions into the <img width> tag.

This entire horizontal bar will be placed in a div that occupies part,
not all of the page.
[color=blue]
>impossible for people on high resolution systems, or with poor eyesight, to
>read the content?)
>(4) You are attempting to apply width to an inline element (span[1]), to
>which it doesn't apply.
>
>I think the problem you are perceiving is caused mainly by having two
>columns without a width set on either. The real problem is your entire
>approach.
>
>[1] Which, as the only element inside the cell, is redundent anyway.
>[/color]
David Dorward
Guest
 
Posts: n/a
#4: Jul 20 '05

re: [Q] table cell spanning whole page?


Sir Loin of Beef wrote:
[color=blue]
> So what should I do?[/color]

Stop top posting.
[color=blue]
> I'd like to have a single horizontal bar with 2 parts -
> the left a small image, and the right, a bar of text spanning the
> remainder of the column width.[/color]

Float the image left.


--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
Closed Thread


Similar HTML / CSS bytes