473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

html table, colspan weirdness I don't know how to work around

I've got my problem down to a very simple example that shows it.
Basically, I have an html table in a header file, and an html in my
body. Both have the same width, and the same number of columns. One
table has 2 actual columns (that span 3 columns each) and the other
has 6 columns (no spanning).

Problem is the two tables don't line up.

What am I not understanding or setting? I'm thinking they should line
up. They don't in IE or firefox.

Here's the simple HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>
Problem Child Code
</title></head>
<body>
<form name="form1" method="post" action="Default5.aspx"
id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJOTI1NTQ5NTU3ZGQ=" />
</div>

<div>
<table id="TableFindEmail" border="0"
cellpadding="0">

<tr>
<td style="width: 134px;">
1
</td>
<td style="width: 133px;">
2
</td>
<td style="width: 133px;">
3
</td>

<td style="width: 133px;">
4
</td>
<td style="width: 133px;">
5
</td>
<td style="width: 134px;">
6
</td>
</tr>

</table>

<table id="Table1" border="0" cellpadding="0">
<tr>
<td style="width: 400px" colspan="3">
1
</td>
<td style="width: 400px" colspan="3">
4
</td>
</tr>

</table>

</div>
</form>
</body>
</html>
Peter Kellner
http://peterkellner.net
Apr 19 '06 #1
3 2513
Peter Kellner wrote:
I've got my problem down to a very simple example that shows it.
Basically, I have an html table in a header file, and an html in my
body. Both have the same width, and the same number of columns. One
table has 2 actual columns (that span 3 columns each) and the other
has 6 columns (no spanning).

<table id="TableFindEmail" border="0" cellpadding="0">
[6 columns removed]
</table>

<table id="Table1" border="0" cellpadding="0">
<tr>
<td style="width: 400px" colspan="3">1</td>
<td style="width: 400px" colspan="3">4</td>
</tr>
</table>

What columns do you expect the second table to span? There are only the
two columns, therefore the colspan is spurious and ignored. The first
table has 6 columns but that is irrelevant to the second table.
If you combine the two tables into one, the columns are aligned.

Your example does not demonstrate your stated problem. It looks okay in
my browser (Mozilla). Until I add borders. You have a "pixel perfect"
design and almost anything will cause it to fall apart. So I suspect you
have left something out, like CSS that adds spacing, borders, margin, etc.
Provide an URL for a test case. It's the only way to be sure.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Apr 19 '06 #2
[This followup was posted to comp.infosystems.www.authoring.html and a
copy was sent to the cited author.]

In article <Lf********************@giganews.com>, jmm-
li***********@sohnen-moe.com says...
Peter Kellner wrote:
I've got my problem down to a very simple example that shows it.
What columns do you expect the second table to span? There are only the
two columns, therefore the colspan is spurious and ignored. The first
table has 6 columns but that is irrelevant to the second table.
If you combine the two tables into one, the columns are aligned.


Your tip was good. It was a combination of cellpadding not being 0 in
my real example as well as a style sheet confusing me.

Thanks for the help.
Apr 19 '06 #3
On Tue, 18 Apr 2006 19:26:51 -0700, Peter Kellner wrote:

cut
Peter Kellner
http://peterkellner.net


What does .... code validations .... stand for?

--
o'tom po'tom
Apr 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Freddy Morel | last post by:
My objective is to make a two columns table from an XML-data file. I do not want to use XSL, so sorting and else is not important for the moment. I have this working in a table:...
19
by: Logix | last post by:
Hello! I'm trying to make a sort of online page building system. In order to do this, I represent my page using a HTML table. One of the most basic templates would be a page divided in six...
18
by: Philipp Lenssen | last post by:
I want to write a third installment of "Little Known HTML Facts"*. I would appreciate your input here. For one thing, I would like to remember what exactly those proprietary icons were you could...
5
by: nivas.meda | last post by:
Hi, I have an excel sheet with a graph and cells.If i change the value in the excel cells the graph will reflect.Now i am going to implement this functionality in html page.I successfully saved...
2
by: Roel Korsten | last post by:
Hello all, I've got a strange one: I'm sending HTML mail via the System.Web.Mail namespace: Dim ObjEmail As New MailMessage Dim sb As New StringBuilder ObjEmail.To =...
3
by: Phil | last post by:
I'm trying to make a 4 x 13 table in html, but it won't format correctly... maybe someone can see what I'm doing wrong. <table border="1"> <tr> <td colspan="3" rowspan="5">Cell 1, 1</td> <td...
5
by: jsavagedesign | last post by:
I am trying to send and email from a form using php. I got that to work. The problem is that when I receve the email it is a text version with all the html tags showing. looks like this:...
10
by: jpollack | last post by:
I don't know JavaScript but have been tasked to write a script that will change the value of a Boolean variable to the word "Yes" on a table row. I have been trying to achieve this based on my...
5
by: smittie31 | last post by:
I am having a problem with a border around me html page. The border does not flow thru the whole html page, it cuts off halfway. --> See http://keithborom.com/marlon-sanders CSS STYLESHEET ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.