Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Full width

Status
Not open for further replies.

katiekat

Technical User
Jun 6, 2000
300
0
0
US
I need to have one row that extends across the entire screen, no matter the width. Is the only way to do that with javascript? Holy tek-tips batman!:-0
 
Are you meaning one table row that spans the entire width while the other rows do not? Or do you simply want the whole table to be stretched across the screen width?

Stretching an entire table is as simple as specifying &quot;width='100%'&quot; within the <table> tag.

If you want one row to be wider than the others, you will either have to make it part of a separate table, or use &quot;padding&quot; cells to fill out the rest of the table.

Here's an example of a single table, with the first row being 100% wide and the others being shorter:

Code:
<table width=&quot;100%&quot;>
 <tr><td colspan=&quot;2&quot; width=&quot;100%&quot;>Long row content</td><tr>
 <tr><td>Other table content</td>
     <td width=&quot;100%&quot;></td></tr>

the second td of the second row will force the first td of the second row to be as narrow as possible. You can decrease the width% of the &quot;padding&quot; td in order to allow the other table content to use more room (otherwise, it might look squashed).
I'm not sure how well this technique will work in older browsers though.

Perhaps a more compliant method would be to use two tables, like this:

Code:
<table width=&quot;100%&quot;>
 <tr><td>Full screen width content here</td></tr></table>
<table>
 <tr><td>Shorter content here</td></tr>
</table>

you may need to use CSS to remove extra space between the tables if you use this method.

I hope this solves your problem! -----------------------
&quot;It's lonely at the top, but you eat better.&quot; -- Unknown
 
Are you meaning one table row that spans the entire width while the other rows do not? Or do you simply want the whole table to be stretched across the screen width?

Stretching an entire table is as simple as specifying &quot;width='100%'&quot; within the <table> tag.

If you want one row to be wider than the others, you will either have to make it part of a separate table, or use &quot;padding&quot; cells to fill out the rest of the table.

Here's an example of a single table, with the first row being 100% wide and the others being shorter:

Code:
<table width=&quot;100%&quot;>
 <tr><td colspan=&quot;2&quot; width=&quot;100%&quot;>Long row content</td><tr>
 <tr><td>Other table content</td>
     <td width=&quot;100%&quot;></td></tr>
</table>

the second td of the second row will force the first td of the second row to be as narrow as possible. You can decrease the width% of the &quot;padding&quot; td in order to allow the other table content to use more room (otherwise, it might look squashed).
I'm not sure how well this technique will work in older browsers though.

Perhaps a more compliant method would be to use two tables, like this:

Code:
<table width=&quot;100%&quot;>
 <tr><td>Full screen width content here</td></tr></table>
<table>
 <tr><td>Shorter content here</td></tr>
</table>

you may need to use CSS to remove extra space between the tables if you use this method.

I hope this solves your problem! -----------------------
&quot;It's lonely at the top, but you eat better.&quot; -- Unknown
 
gah! sorry about the multi-post.. I got an error message the first time and thought it didn't go through! -----------------------
&quot;It's lonely at the top, but you eat better.&quot; -- Unknown
 
Here's what I'm doing. I am going to place a flash menu in one row of a table which will seperate the rest of the content from a header. I want this to look like a band of color across the entire screen, with no little white bits at the end, no matter what size screen you have.

Make sense?

thanks!!!

k Holy tek-tips batman!:-0
 
I havent yet, but I will try that. Thanks! I bet that will be the thing.

:) K Holy tek-tips batman!:-0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top