473,698 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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"><tit le>
Problem Child Code
</title></head>
<body>
<form name="form1" method="post" action="Default 5.aspx"
id="form1">
<div>
<input type="hidden" name="__VIEWSTA TE" id="__VIEWSTATE "
value="/wEPDwUJOTI1NTQ5 NTU3ZGQ=" />
</div>

<div>
<table id="TableFindEm ail" 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 2529
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="TableFindEm ail" 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.infosystem s.www.authoring.html and a
copy was sent to the cited author.]

In article <Lf************ ********@gigane ws.com>, jmm-
li***********@s ohnen-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
2398
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: |-------------------------------| | table heading OK | |-------------------------------| | R1-C1 | R1-C2 | R1-C3 | R1-C4 | | R2-C1 | R2-C2 | R2-C3 | R2-C4 | | R3-C1 | R3-C2 | R3-C3 | R3-C4 |.....
19
13376
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 equally proportioned rectangles: <table border="1" cellspacing="0" cellpadding="0" width="200" height="200"> <tr>
18
3970
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 use -- I believe something like "&happyface;" would display a happy face, and so on, for folders, disk drives, and other technical icons. I found something called "&folder;" and "&audio;" (straight from the horse's mouth, at the W3C) but can't...
5
2925
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 this as interactive html page.Now my requirement changes a bit.The excell cells will not visible to others.i have a text box,If i change the value in text box the excel template cell value need to change. I did the follwing steps for creating...
2
1460
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 = 'someone@thisnewsgroup.com ObjEmail.From = ConfigurationSettings.AppSettings("MailFrom")
3
1800
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 rowspan="4">Cell 1, 4</td> </tr> <tr> <td>Cell 5, 4</td>
5
1964
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: <HTML><HEAD><TITLE></TITLE></HEAD><BODY><table width="440" border="1" cellspacing="0" cellpadding="3"><tr><td colspan="2"><em>The following was receved from the General Estimate form</em></td></tr><tr><td colspan="2" style="background-color:#2362ac;...
10
1893
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 knowledge of ActionScript. Needless to say, I have not been successful! ##CUSTOM_SUB_MARKETEYE## is a tag that pulls the Boolean result from a database. It returns 1 when it is true and null when it is false. I need to convert that "1" to the word "Yes"...
5
2450
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 /* CSS for Marlon Sanders site */ html, body {
0
8612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.