473,398 Members | 2,335 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,398 software developers and data experts.

Formating a table

BT
I'm trying to format a three column table and I can't get things to line up
the way I need to. The first column is text of variable length that might
wrap onto multiple lines. It is within <p></p> tags to right/left justify
it. The second column is a column of ditto marks, centered left/right in
the cell and aligned with the bottom line of text of column 1. The third
column is a column of numbers also aligned with the bottom line of text in
column 1, but these numbers need to be right justified.

Here is the code:

<tr>
<td valign="top"><p>Ressaldar Fatteh Khan, Khuttuk, who at
the head of seventy men of the Guides'
Cavalry defeated and drove into
Mooltan a Brigade of Sikh Cavalry,
from a picture by W. Carpenter. By
kind permission of General Sir Peter
Lumsden, G.C.B.</p> </td>
<td valign="bottom" align="center"> &quot; </td>
<td valign="bottom" align="right">24</td>
</tr>
If I remove the <p> tags from the first column, I can get the valign correct
in columns 2 and 3, but I loose the left/right justification I need in
column 1. I tried to add <p> tags to columns 2 & 3, but then I seem to
loose the left/right alignment of column 2 and 3. I tried to change valign
in column 1 to 'top', with no improvement.

Any ideas? thanks, BDT


Sep 4 '05 #1
6 1808
BT
BTW, I'm doing this as Doctype: XHTML 1.0 Strict and I've been checking its
layout in Firefox V 1.0.6 and MS IE 6.

thanks, BDT

"BT" <no@xnono.com> wrote in message
news:o5********************@tornado.texas.rr.com.. .
I'm trying to format a three column table and I can't get things to line
up the way I need to. The first column is text of variable length that
might wrap onto multiple lines. It is within <p></p> tags to right/left
justify it. The second column is a column of ditto marks, centered
left/right in the cell and aligned with the bottom line of text of column
1. The third column is a column of numbers also aligned with the bottom
line of text in column 1, but these numbers need to be right justified.

Here is the code:

<tr>
<td valign="top"><p>Ressaldar Fatteh Khan, Khuttuk, who at
the head of seventy men of the Guides'
Cavalry defeated and drove into
Mooltan a Brigade of Sikh Cavalry,
from a picture by W. Carpenter. By
kind permission of General Sir Peter
Lumsden, G.C.B.</p> </td>
<td valign="bottom" align="center"> &quot; </td>
<td valign="bottom" align="right">24</td>
</tr>
If I remove the <p> tags from the first column, I can get the valign
correct in columns 2 and 3, but I loose the left/right justification I
need in column 1. I tried to add <p> tags to columns 2 & 3, but then I
seem to loose the left/right alignment of column 2 and 3. I tried to
change valign in column 1 to 'top', with no improvement.

Any ideas? thanks, BDT

Sep 4 '05 #2
"BT" <no@xnono.com> wrote:
I'm trying to format a three column table and I can't get things to
line up the way I need to.
Your question would thus appear to relate to CSS rather than HTML.
The first column is text of variable length
that might wrap onto multiple lines. It is within <p></p> tags to
right/left justify it.
Whether you use <p> markup should depend solely on the question whether you
have a _paragraph_ of text.

Besides, <p> markup does not cause any "right/left justify", whatever you
mean by that. You need to explain your problem using common terms, not
invented expressions.

Oh, and please post the URL.
The second column is a column of ditto marks,
No, in your snippet, it contains the Ascii quotation mark.
If I remove the <p> tags from the first column, I can get the valign
correct in columns 2 and 3, but I loose the left/right justification I
need in column 1.


Remove the tags, since you have no paragraph there. Then write suitable
CSS, or if you insist on using deprecated technology, some clumsy HTML
attributes for vertical and horizontal alignment. If problems remain, post
the URL and explain what you regard as undesirable in the appearance.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Sep 4 '05 #3
BT

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn****************************@193.229.0.31.. .
"BT" <no@xnono.com> wrote:
I'm trying to format a three column table and I can't get things to
line up the way I need to.
Your question would thus appear to relate to CSS rather than HTML.


Yes, it could be done with CSS, but since the page will only have one
table there seems to be little or no reason to set it up with CSS. If there
is a good CSS solution, please advise.
The first column is text of variable length
that might wrap onto multiple lines. It is within <p></p> tags to
right/left justify it.
Whether you use <p> markup should depend solely on the question whether
you
have a _paragraph_ of text.


Yes, there is a paragraph of text as the code example shows.

Besides, <p> markup does not cause any "right/left justify", whatever you
mean by that. You need to explain your problem using common terms, not
invented expressions.
Perhaps my terminology confuses you. Before I added the <p> tags, the text
was left justified, probably by default (left justified meaning that the
left side
of each line was even with any line in the same paragraph immediate above
and/or below it) and the right side of the paragraph was ragged with no
alignment.

After I added the <p> tags, both the left and right sides of the paragraph
lined up
smoothly. What is the 'common term' for this paragraph layout?

Oh, and please post the URL.
There is no URL yet. This is a small table in a book of about 8000
lines and will eventually be posted to www.gutenberg.org
The second column is a column of ditto marks,
No, in your snippet, it contains the Ascii quotation mark.


You are correct.
If I remove the <p> tags from the first column, I can get the valign
correct in columns 2 and 3, but I loose the left/right justification I
need in column 1.
Remove the tags, since you have no paragraph there. Then write suitable
CSS, or if you insist on using deprecated technology, some clumsy HTML
attributes for vertical and horizontal alignment. If problems remain, post
the URL and explain what you regard as undesirable in the appearance.


As indicated in my follow-up, 'Doctype: XHTML Strict' so I don't plan
to use any deprecated tags. As a volunteer learning to do this I recognize
that I may end up with some clumsy HTML. I only ask for assistance to
learn and to minimize clumsy HTML.

If there isn't enough info here for you to be able to offer meaningful
assistance, perhaps someone else can.

thank you, BDT

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Sep 4 '05 #4

BT wrote:
I'm trying to format a three column table and I can't get things to line up
the way I need to ..... Any ideas? thanks, BDT


Check these references:

http://www.w3.org/2002/11/homepage

http://www.w3.org/2002/03/csslayout-howto

http://www.glish.com/css/

--
James Pickering
http://jp29.org/
(CSS 3 column layout)

Sep 4 '05 #5
BT wrote :
I'm trying to format a three column table and I can't get things to line up
the way I need to. The first column is text of variable length that might
wrap onto multiple lines.
Are you using the correct markup for a paragraph then? The best practice
is to render a paragraph is to use a <p> and the best practice to render
tabular data is to use a <table>. Otherwise, your markup code can not
best be rendered, can not best degrade gracefully in several media, user
agents, web-aware applications.

It is within <p></p> tags to right/left justify it. The second column is a column of ditto marks,
Sorry... what's ditto marks?

centered left/right in the cell and aligned with the bottom line of text of column 1. The third
column is a column of numbers also aligned with the bottom line of text in
column 1, but these numbers need to be right justified.

Can you post an url about all this? Are you truly designing for major
blocks of content or for tabular data here... I'm still not sure...
Here is the code:

<tr>
<td valign="top"><p>Ressaldar Fatteh Khan, Khuttuk, who at
the head of seventy men of the Guides'
Cavalry defeated and drove into
Mooltan a Brigade of Sikh Cavalry,
from a picture by W. Carpenter. By
kind permission of General Sir Peter
Lumsden, G.C.B.</p> </td>
<td valign="bottom" align="center"> &quot; </td>
<td valign="bottom" align="right">24</td>
</tr>
Can you describe what your webpage is about, general description...
If I remove the <p> tags from the first column, I can get the valign correct
in columns 2 and 3, but I loose the left/right justification I need in
column 1. I tried to add <p> tags to columns 2 & 3, but then I seem to
loose the left/right alignment of column 2 and 3. I tried to change valign
in column 1 to 'top', with no improvement.

Any ideas? thanks, BDT


Here's a few resources to help you start. I have not checked in details
each of these resources but I'd say they should bring you more values
than problems, in the short term and long run:

Learning HTML and CSS:
- HTML Dog: http://www.htmldog.com/
- CSS Recommendations, best CSS practices and 12 very valuable CSS tips:
http://www.456bereastreet.com/lab/de...standards/css/
- http://tutorials.alsacreations.com/

Learning website design (a bit outdated at places but overall excellent
resources):
Dan's website design tips:
http://webtips.dan.info/

W3C Quality Assurance tips (I highly recommend each tip):
Quality Tips for Webmasters
http://www.w3.org/QA/Tips/

List of CSS templates:
http://www.maxdesign.com.au/presenta...outs/index.cfm

Simple 2 column CSS layout with tutorial on how to create templates:
http://www.456bereastreet.com/lab/de...slayout/2-col/
How to create templates is useful as you learn eventually how to manage,
tweak, tune, upgrade, customize or modify your own webpages based on
such template

3 columns (abs. pos.) scalable and fluid:
http://www.positioniseverything.net/...l.stretch.html

3 columns scalable and fluid (The “I can't believe it's not a table!”
layout):
http://www.positioniseverything.net/threecolbglong.html

Gérard
--
remove blah to email me
Sep 4 '05 #6
"BT" <no@xnono.com> wrote:
Yes, it could be done with CSS, but since the page will only have one
table there seems to be little or no reason to set it up with CSS. If
there is a good CSS solution, please advise.
It's probably easier in CSS than in HTML, even if you need to use class
attributes in many cells. (Still simpler than putting several attributes in
cells.)
Whether you use <p> markup should depend solely on the question
whether you have a _paragraph_ of text.


Yes, there is a paragraph of text as the code example shows.


It's not a paragraph under a normal definition of "paragraph".
Before I added the <p> tags, the
text was left justified, probably by default
Left justified is generally the default in HTML.
After I added the <p> tags, both the left and right sides of the
paragraph lined up
smoothly. What is the 'common term' for this paragraph layout?
That's called justification, and adding the <p> markup did _not_ cause it
unless you have some style sheet that sets properties for p elements.

Justification is seldom justified on the Web, since browsers do it so
poorly and since it reduces legibility.

So why did you add the <p> tags?
Oh, and please post the URL.


There is no URL yet.


Then create one and post it. Even if it's just your current best effort.
After all, it's a matter of simple upload.
As indicated in my follow-up, 'Doctype: XHTML Strict' so I don't plan
to use any deprecated tags.


Why do you plan to use XHTML? Do you realize that IE does not grok XHTML?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Sep 4 '05 #7

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

Similar topics

6
by: Polar | last post by:
I have a database that stories entries of short stories for a writers website. I can easily input the data into MYSQL but my trouble lies in retrieving the data. the story in just cut and...
0
by: Gerald Thallinger | last post by:
Hallo together! I try so solve the following problem. I wrote a HTML-File an print it via MS Internet Explorer, Version 6.0. I currently have all 3 tables in my report for outputting. I...
6
by: Dave Smithz | last post by:
Hi there, A client of mine wants to start generating some reports from their PHP / MYSQL database. They were previously gathering data from the screen and cutting and pasting it into a Word...
0
by: rodrigo guerra | last post by:
where i can change the code formating that visual studio does in the code.... like if i type: if ( ) { .... } visual studio changes to:
0
by: Dmitri Manushin | last post by:
Hi all, i have textBox (multiline) i'am enter many words and don't push enter next i push button and text record in database. When i read data from database in table i'am use teg <pre> for save...
3
by: Smiley | last post by:
Hi, I know how to do confitional formating in Excel by clicking the wizard. Is this possible in MS Access ? If so, please directly where to look. I found example but nothing as to how to do it....
2
by: just_me | last post by:
Hello, I'd like to ask if anyone knows the format /category/13/ where probably 13 is the ID if it's actually a directory/file and a script automatically created it when someone updated his site...
2
by: Amorphous | last post by:
Hi. I've got a bit of a problem. I need to make several tables for a forum post. I can use HTML, but I cannot edit the HTML of the page itself outside of the post area. I cannot edit <head> or...
0
by: Fonix | last post by:
I'm trying to make table border with pyExcelerator. As i can see there is only cell formating!? If i'm wrong pls tell me what is method to make more then one cell to have same format, other then...
2
by: sitko | last post by:
Hi, I'm in the process of converting a VB.net program into a C program so it can run on a unix like machine. I've been moving along at a nice pace, but this conversion has stumped me. I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.