Cell Height using CSS

  • Thread starter Thread starter Fuse - News
  • Start date Start date
F

Fuse - News

I have a little problem.

I'm converting our site from using lots of HTML to CSS.

I've gotten most of the site redesigned and looking like the original with
CSS. However, there is one cell that will not work properly. The cell
height is to high and no matter what I try in CSS, margin, padding, the cell
will not shrink down to fit one line of text across the width of it.

The height size is about 7x that. The only way to get that cell to shrink
down to one line of text is to use the cell height in frontpage and not so
in CSS.

Can anyone tell me if you can replicate the cell height in CSS. I've looked
all over the place and read a lot on CSS without any clues as to where to go
to.
 
A cell will be the same height as the tallest cell in the row. Look and see
what is in other cells on the same row or if you have forced a height on the
table. If you still can't find the problem post a url.
 
Also have you checked the cell for empty carriage returns?? ( the enter key )
They will look like this <br> or this <p&nbsp;</p>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
I just had a similar problem converting over to CSS. What I had done was use the TR tag in my css file. I had been using the table tag but kept running into problems. Table tag had been changing my row heights so removed it from my css file and used a TR tag and it all come together

Michae
----- Fuse - News wrote: ----

I have a little problem

I'm converting our site from using lots of HTML to CSS

I've gotten most of the site redesigned and looking like the original wit
CSS. However, there is one cell that will not work properly. The cel
height is to high and no matter what I try in CSS, margin, padding, the cel
will not shrink down to fit one line of text across the width of it

The height size is about 7x that. The only way to get that cell to shrin
down to one line of text is to use the cell height in frontpage and not s
in CSS

Can anyone tell me if you can replicate the cell height in CSS. I've looke
all over the place and read a lot on CSS without any clues as to where to g
to
 
Sorry about that,

The cell I'm most interested in fixing is the one with the following text:
Home - Next Link - Next Link
 
1. You can't assign external CSS files to Shared Borders or FP Include Pages, you must define any
CSS that applies to Include content in the CSS file that applied to the pages that the Includes will
be included into.

2. In the code below, I rearrange it so that all <td>...</td> start and end on a single line, and
not wrapped. However posting it here, it will most likely wrap.

<table border="0" width="100%" cellspacing="0" cellpadding="4">
<tr>
<td class="footerad">&nbsp;</td>
</tr>
</table>
<!---------- PLACE "<BR>" TAG HERE FOR BREAK BETWEEN CELLS ---------->
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td bgcolor="#666666" class="footer" width="256"><a href="../index.htm"><img border="0"
src="../images/site_images/footer_filler.gif" width="220" height="20" alt="I wanna go
home!"></a></td>
<td nowrap align="middle" bgcolor="#666666" height="20" class="footer"
width="256">&nbsp;&nbsp;&nbsp;</td>
<td bgcolor="#666666" class="footer" width="256"><img height="1"
src="../images/site_images/spacer.gif" width="100"></td>
</tr>
<tr>
<td colspan="3" class="copyright"><img height="1" src="../images/site_images/spacer.gif"
width="220" border="0"></td>
</tr>
<tr bgcolor="#333399">
<td align="middle" colspan="3" height="20" class="footer" bgcolor="#FBCA00"><a
href="../index.htm">Home</a>&nbsp;&nbsp;<a href="../inquires/teamsource.htm">Contact Us</a></td>
</tr>
<tr>
<td align="middle" colspan="3" class="copyright">Copyright © 1999-2004 ATV Source -- All Rights
Reserved<br>Use of ATVSource.com is subject to certain <a target="_blank"
href="../inquires/termsofuse.htm">terms of use</a>. We respect your <a target="_blank"
href="../inquires/privacy_statement.htm">privacy</a>.<br>Do not copy or reproduce graphics, text,
html code without written permission from <a href="../inquires/teamsource.htm">ATV
Source</a></font></td>
</tr>
</table>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Thomas,

The header/footer include pages haven't been changed over to complete CSS
yet. We are still working on just the main navigation and body content.

Quote:
"1. You can't assign external CSS files to Shared Borders or FP Include
Pages, you must define any CSS that applies to Include content in the CSS
file that applied to the pages that the Includes will be included into."

This sentence totally confused the heck out of me. As the partial CSS we
have defined now for the include pages work without a hitch. If you can
describe this in more detail, I might be able to understand it better.

We are still looking for an answer to the Home - Next Link - Next Link cell
height problem.






Thomas A. Rowe said:
1. You can't assign external CSS files to Shared Borders or FP Include Pages, you must define any
CSS that applies to Include content in the CSS file that applied to the pages that the Includes will
be included into.

2. In the code below, I rearrange it so that all <td>...</td> start and end on a single line, and
not wrapped. However posting it here, it will most likely wrap.

<table border="0" width="100%" cellspacing="0" cellpadding="4">
<tr>
<td class="footerad">&nbsp;</td>
</tr>
</table>
<!---------- PLACE "<BR>" TAG HERE FOR BREAK BETWEEN CELLS ---------->
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td bgcolor="#666666" class="footer" width="256"><a
href="../index.htm"><img border="0"
 
1. You can apply CSS tags to the content in the files to be included in other pages. However the
link to the external CSS style sheet must be on the pages that the included file will be included
in, i.e., your main page is Index.htm and you are including nav.htm into it. On nav.htm you have CSS
tags, where the definition is in an external nav.CSS file. The nav.CSS file can not be linked to the
..nav.htm file, it must be linked to index.htm where the nav.htm will be included.

2. This issue with the spacing is in your footer include page, correct? If so then take the code I
provided, paste into Notepad, make sure Word Wrap is off, then make sure you have a single line for
each <td> ... content .... </td> tag set. See if that solves your spacing problem.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Hi,

Thomas A. Rowe said:
1. You can apply CSS tags to the content in the files to be included in other pages. However the
link to the external CSS style sheet must be on the pages that the included file will be included
in, i.e., your main page is Index.htm and you are including nav.htm into it. On nav.htm you have CSS
tags, where the definition is in an external nav.CSS file. The nav.CSS file can not be linked to the
.nav.htm file, it must be linked to index.htm where the nav.htm will be
included.

I think I understand now. We have the CSS link: (<link rel="stylesheet"
type="text/css" href="atvsource.css">) in the pages that will be FP
includes, plus we have this CSS link on the page that those include are
pulled into.
2. This issue with the spacing is in your footer include page, correct? If so then take the code I
provided, paste into Notepad, make sure Word Wrap is off, then make sure you have a single line for
each <td> ... content .... </td> tag set. See if that solves your spacing
problem.

As for your comment above, nope, the footer has nothing to do with my
problem. I can remove all the include pages around the main content and the
problem is still there. Do not know what is causing this. We might have
use the cell height tag then to remedy this problem but wish not too. Weird
thing we've noticed. If we place a lot of text on the page, the Nav links
we are trying to get onto one line within a cell, shrink to that one line
and look like they are suppose too. We remove some text and you can see the
cell start to expand as each row of text is removed.

What would be causing this and how can one fix it using CSS instead of using
the cell height in FP?
 
Sorry, I was looking in the wrong place.

I prefer to avoid using CSS for any type of layout. Sticking with tables allows me to quick quickly
create a page layout in less time, and with a very good chance that it will display correctly in all
browsers.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
The problem is caused by the cells heights being changed to fill the space
available. The space is determined by the highest cell - the left
navigation, and all other rows in the table ahave their heights
proportionately adjusted (by content height) to match the total height.
Some browsers will ignore the cell height attribute (if you use it), and
this is a minimum value, anyway.

Here is one solution (but it creates another problem with cell borders...)

<table cellspacing="0">
<tr>
<td class="left-content">
<!--webbot bot="Include" u-include="template_site_nav_left.htm"
tag="BODY" --></td>
<td class="mainbodyspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="navsubmenu"><a href="../index.htm">Home</a>
<img border="0" src="../images/site_images/dir_arrow.gif" width="12"
height="8">
<a href="../clubs/index.htm">Next Link</a>
<img border="0" src="../images/site_images/dir_arrow.gif" width="12"
height="8">
Next Link</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="mainbody">
<p>Test Text For Immediate Release</p>

<p>Rest of mainbody content</p>

</td>
</tr>
</table>
</td>
<td class="mainbodyspacer">&nbsp;</td>
<td class="right-content">&nbsp;<!--webbot bot="Include"
u-include="template_ad_space_vertical.htm" tag="BODY" --></td>
</tr>
</table>

HTH
 
Poorly designed html table structure
- you have 1 table for the 5 columns (3 plus 2 spacers) and are trying to control them w/ cell properties
- the content of the center is affected by rowspan attributes in the 2 outer cells

If you need 3 independent areas on a page, create an outer table (1 row, 3 columns) and nest a separate table in each cell for each
column
- that way the cells of each nested table are independent of the outer table cells

In the simplest form (w/o your spacers) your entire page should be laid out as

<div align="center">
<table border="0" cellpadding="0"><tr>
<td>Top Include</td></tr></table>
<table border="0" cellpadding="0"><tr><td>
<table border="0" cellpadding="0"><tr>
<td>Left Include</td>
</tr></table>
</td><td>
<table border="0" cellpadding="0"><tr>
<td>Center Include</td>
</tr></table>
</td><td>
<table border="0" cellpadding="0"><tr>
<td>Right Include</td>
</tr></table>
</td></tr></table>
<table border="0" cellpadding="0"><tr>
<td>Bottom Include</td>
</tr></table></div>


PS
Your spacer cell are empty and will be collapsed by most browsers
- use a transparent .gif or at least 2 &nbsp; to keep them from collapsing
- or use cell padding/spacing on the inner nested table in the new design to eliminate the need for the spacer cells
--




| Sorry about that,
|
| The cell I'm most interested in fixing is the one with the following text:
| Home - Next Link - Next Link
|
|
|
|
|
| | > Hi,
| >
| > I'm still stuck on this cell thing. Here's the web address to the files
| > that I'm working on:
| > http://www.atvsource.com/z_site_nav/1_atvsoure_layout.htm
| >
| > Web address to the CSS file:
| > http://www.atvsource.com/z_site_nav/atvsource_workable.css
| >
| > Any help would be much appreciated.
| >
| >
| >
| >
| >
| > | > > A cell will be the same height as the tallest cell in the row. Look and
| > see
| > > what is in other cells on the same row or if you have forced a height on
| > the
| > > table. If you still can't find the problem post a url.
| > >
| > > --
| > > Cheryl D. Wise
| > > MS-MVP-FrontPage
| > > (e-mail address removed)
| > >
| > >
| > > | > > >I have a little problem.
| > > >
| > > > I'm converting our site from using lots of HTML to CSS.
| > > >
| > > > I've gotten most of the site redesigned and looking like the original
| > with
| > > > CSS. However, there is one cell that will not work properly. The
| cell
| > > > height is to high and no matter what I try in CSS, margin, padding,
| the
| > > > cell
| > > > will not shrink down to fit one line of text across the width of it.
| > > >
| > > > The height size is about 7x that. The only way to get that cell to
| > shrink
| > > > down to one line of text is to use the cell height in frontpage and
| not
| > so
| > > > in CSS.
| > > >
| > > > Can anyone tell me if you can replicate the cell height in CSS. I've
| > > > looked
| > > > all over the place and read a lot on CSS without any clues as to where
| > to
| > > > go
| > > > to.
| > > >
| > > >
| > > >
| > > >
| > >
| > >
| >
| >
| >
|
|
|
 
Poorly designed html table structure

Hmm.... didn't know there could be such a thing by using a template provided
by FP and then altering that template for our own needs. Guess nothing comes
easy.
<div align="center">
<table border="0" cellpadding="0"><tr>
<td>Top Include</td></tr></table>
<table border="0" cellpadding="0"><tr><td>
<table border="0" cellpadding="0"><tr>
<td>Left Include</td>
</tr></table>
</td><td>
<table border="0" cellpadding="0"><tr>
<td>Center Include</td>
</tr></table>
</td><td>
<table border="0" cellpadding="0"><tr>
<td>Right Include</td>
</tr></table>
</td></tr></table>
<table border="0" cellpadding="0"><tr>
<td>Bottom Include</td>
</tr></table></div>

We do have this layout, but missing the extra center table. The left and
right cells are using an inner table provided by a FP include file.

We'll try your approach by adding a table to the inner cell and see if we
can get it to work for us.
PS
Your spacer cell are empty and will be collapsed by most browsers
- use a transparent .gif or at least 2 &nbsp; to keep them from collapsing
- or use cell padding/spacing on the inner nested table in the new design
to eliminate the need for the spacer cells

Nah, are spacer cells are using CSS with padding (.mainbodyspacer
{background-color: #EAEAEA; padding: 0.05em;}) to obtain that extra space
between the rightside/leftside cells. This way, we do not have to worry
about using a transparent.gif and or the &nbsp; html code. Less html code
and hits on the server to render a page. (suggestion provided by "Eric Meyer
on CSS" book)

Thanks for all the suggestions and help, much appreciated.

We are still learning the basics of CSS and how to utilize it in our web
design. We are hoping to make thing easier on us in future site expansions.
As always, we'll be back for more advice and help, this I do know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top