Simple table--weird results

O

OccasionalFlyer

I don't make any claims to be an HTML expert but I've written more
than a few tables in my experience. So I am totally baffled by the
results I'm getting from some very simple table code. Alas, I can't
figure out a way to test it without making it live, so I'd appreciate
a quick response so I can get something yucky off my site please.

I used this code:
<table width="102%" cellpadding="5" cellspacing="0" border="1">
<tr align="left" valign="top" >
member
</tr>
<tr align="left" valign="top" >
1
</tr>
<tr align="left" valign="top">
2
</tr>
</table>

It displays the table, however, as only two lines:
member 1 2
dark black horizontal line
I've never seen such a thing.

What I wanted to do was this:
<table width="102%" cellpadding="5" cellspacing="0" style="border: 1px
solid black">
<tr align="left" valign="top" style="font-family: Arial; font-size:
120%; border: 1px solid black;">
member
</tr>
<tr align="left" valign="top" style="text-indent: 8px; font-family:
Arial; font-size: 100%; border: 1px solid black">
1
</tr>
<tr align="left" valign="top" style="text-indent: 8px; font-
family: Arial; font-size: 100%; border: 1px solid black">
2
</tr>
</table>

I haven't put real values on the page yet because I'm still trying to
make it work. I know that this is not how you're supposed to do CSS
but I'm trying to cope with doing HTML in an ASP.NET environment and
don't know how to cope with that.

However, this simple table ought to work. I looked at the page
source but saw nothing. Please help. Thanks.

Ken
 
O

OccasionalFlyer

Never mind. I solved my mistake. I guess I've never really made a
table this simple but I didn't know you were required to sue the td
tag. That seems dumb to me.
 
R

richard

I don't make any claims to be an HTML expert but I've written more
than a few tables in my experience. So I am totally baffled by the
results I'm getting from some very simple table code. Alas, I can't
figure out a way to test it without making it live, so I'd appreciate
a quick response so I can get something yucky off my site please.

I used this code:
<table width="102%" cellpadding="5" cellspacing="0" border="1">
<tr align="left" valign="top" >
member
</tr>
<tr align="left" valign="top" >
1
</tr>
<tr align="left" valign="top">
2
</tr>
</table>

It displays the table, however, as only two lines:
member 1 2
dark black horizontal line
I've never seen such a thing.

What I wanted to do was this:
<table width="102%" cellpadding="5" cellspacing="0" style="border: 1px
solid black">
<tr align="left" valign="top" style="font-family: Arial; font-size:
120%; border: 1px solid black;">
member
</tr>
<tr align="left" valign="top" style="text-indent: 8px; font-family:
Arial; font-size: 100%; border: 1px solid black">
1
</tr>
<tr align="left" valign="top" style="text-indent: 8px; font-
family: Arial; font-size: 100%; border: 1px solid black">
2
</tr>
</table>

I haven't put real values on the page yet because I'm still trying to
make it work. I know that this is not how you're supposed to do CSS
but I'm trying to cope with doing HTML in an ASP.NET environment and
don't know how to cope with that.

However, this simple table ought to work. I looked at the page
source but saw nothing. Please help. Thanks.

Ken

It's a wonder it works at all.
data within a table is placed inside a "data cell", ergo, "<td></td>" will
be required.
<tr> merely begins a new row. It does not hold the data.

Why are you trying to make the table 102% of it's container? Not possible.
 
D

dorayme

richard said:
Why are you trying to make the table 102% of it's container? Not possible.

Good question, there might even be a good answer. But it *is*
possible:

<style type="text/css" media="all">
div {width: 200px; height: 100px; border: 1px dotted red;}
table {width: 150%; height: 150%; border: 1px solid green;}
</style>
</head>
<body>
<div>
This is a DIV
<table>
<tr>
<td>This is a TD</td>
</tr>
</table>
</div>
 
O

OccasionalFlyer

The reason is that I copied this from another page at my site and I
assume, apparently falsely, that the author knew what he was doing. I
thought that this would make the table spill over the margins a
little. Thanks for the brief explanation of why TD is needed.

Ken
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top