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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a Paragraph Inside a Table 2

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi html experts,

I need to add a paragraph <p> section in an existing table.

2 questions: 1) is it html4-compliant to have a paragraph
inside a table?

2) is there a better alternative? (I need a border around the paragraph text)

thanks, john
 
use

<DIV sytle="border: 1px solid #000000;">My text HERE</DIV>

you can also set the overflow to scroll if you have a specific dimension you are confined to.

zzzzzz
 
Thanks deecee,

This is what I have now.....

<DIV sytle="border-color: #000000; border-style: solid; border-width: thin; margin-left: 1in">
<table bgcolor=#FFFFFF align="CENTER" rules="none" border="1" width="70%" cellpadding=0>

<tr bgcolor=#0000FF>
<td color:#000000 align="center"><a href="index.html">Services We Offer</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="qualifications.htm">Qualifications</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="clients.htm">Some of Our Clients</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="about.htm">About Lone Star</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="contact.htm">Contact Us</a></td>
</tr>
</table>
<h3 align="center">About Lone Star...</h3>
<br>
<p>Since 1989, Lone Star Trucking Safety Consultant
Services has been helping trucking firms with safety
issues including DOT compliance and Loss Control
recommendations. We have clients from Utah to Florida. Our rates are
reasonable... why not give us a call?
</p>
</DIV>

But I dont get a border. I need a width of 70% for this text area.

Thanks to anyone for any ideas. John

 
here you go a bit cleaner

Code:
<style type="text/css">
<!--
#test {
	border-color: #000000;
	border-style: solid;
	border-width: thin;
	width: 100%;
}
-->
</style>
</head>

<body>

<table bgcolor=#FFFFFF align="CENTER" rules="none" border="1" width="70%" cellpadding=0>

<tr bgcolor=#0000FF>
    <td color:#000000 align="center"><a href="index.html">Services We Offer</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="qualifications.htm">Qualifications</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="clients.htm">Some of Our Clients</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="about.htm">About Lone Star</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="contact.htm">Contact Us</a></td>
</tr>
<h3 align="center">About Lone Star...</h3>
<br>
<tr><td><DIV id="test">Since 1989, Lone Star Trucking Safety Consultant
Services has been helping trucking firms with safety
issues including DOT compliance and Loss Control
recommendations. We have clients from Utah to Florida. Our rates are
reasonable... why not give us a call?
</DIV></td></tr>
</table>
</body>

zzzzzz
 
1) is it html4-compliant to have a paragraph inside a table?"

Absolutely, no problem at all. Lots of people put the whole content of their page - paragraphs, images, the lot - inside a big table cell.

"2) is there a better alternative?"

Can't think of one. If it's a paragraph, why not mark it up as a paragraph?

You can put your finished page through the validator at - that will tell you whether you're HTML4 compliant or not (you're not, btw).

Incidentally, you should be able to do it without any tables at all. I'm trying to figure out, though, just where you want this border to appear. Do you really want it just around the paragraph, or do you want it around the whole menu bar, h3 and paragraph?

Here's my table-free attempt at what I think you're trying to do:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL] 
<html>
<head>
<title>Layout Test</title>
<style>
.box {
   border: thin solid black;
   width: 70%;
   margin-left: 15%;
   text-align: center;
}

.menu, .menu a {
   background-color: #0000FF;
   color: #FFFFFF;
   margin-top: 0;
   text-decoration: none;
}
</style>
</head>
<body>
  <div class="box">
    <p class="menu">
      <a href="index.html">Services We Offer</a>&nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="qualifications.htm">Qualifications</a>&nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="clients.htm">Some of Our Clients</a>&nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="about.htm">About Lone Star</a>&nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="contact.htm">Contact Us</a>
    </p>
    <h3>About Lone Star...</h3>
    <p>
      Since 1989, Lone Star Trucking Safety Consultant
      Services has been helping trucking firms with safety
      issues including DOT compliance and Loss Control
      recommendations. We have clients from Utah to Florida. Our rates are
      reasonable... why not give us a call?
    </p>
  </div>
</body>
</html>
Is that close? If I was being really fancy, I'd put the menu in a <ul> and use CSS to style it into a horizontal list. I'd also use a <h1> instead of a <h3> and style it to the font size I wanted. But you get the idea...

-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top