468,511 Members | 1,650 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,511 developers. It's quick & easy.

[Q] table cell spanning whole page?

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?
Jul 20 '05 #1
3 4726
Sir Loin of Beef wrote:
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?


(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
Jul 20 '05 #2
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.
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.

Jul 20 '05 #3
Sir Loin of Beef wrote:
So what should I do?
Stop top posting.
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.


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
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

61 posts views Thread by Toby Austin | last post: by
2 posts views Thread by steventhrasher42 | last post: by
117 posts views Thread by phil-news-nospam | last post: by
8 posts views Thread by Gianni Rondinini | last post: by
1 post views Thread by Bart Lateur | last post: by
17 posts views Thread by Liam Gibbs | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.