473,473 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[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 4891
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kai Grossjohann | last post by:
I have a table which contains a top-aligned table cell: .... <tr style="height:40"> ... <td colspan="1" rowspan="2" align="left" valign="top" style="overflow:hidden;">...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
2
by: steventhrasher42 | last post by:
I can't figure out a way to possibly make this work in HTML. I have a table embedded in another table, with the inner table spanning a few columns. I would like for the outer table to span the...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
8
by: Gianni Rondinini | last post by:
hi all, i'm here again. i couldn't find/understand this on w3c css2 recommendation and documentation, then here i ask. i decided to still use some tables in my pages for some forms. i played...
7
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is...
1
by: Bart Lateur | last post by:
I'm trying to put a utton at the bottom (right) of a TD cell, irrespective of what else is in there. Usually, with other HTML block elements, we're told to use position: relative on the...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
17
by: Liam Gibbs | last post by:
Hello everyone, I'm having a problem with a site I'm building. It uses tables, but it's really tricky. A picture of the layout I need can be found at http://www.altmarvel.net/Liam/WHATINEED.jpg...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.