Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 01-05-2006, 10:35 PM   #1 (permalink)
Crazy
 
Location: Ahh, the lovely South
[HTML] Keeping text from running up beside a table

I'm just starting to learn HTML/CSS, and I'm trying to figure out how to deal with tables that aren't the full width of my document. If I have another <p> section below the table, the first part of the text starts to the side of the top of the aforementioned table whenever I have the table aligned to the left or right.

I made a quick example to show you what I'm talking about.

Is there a way to align my table to one side or the other without the text wrapping around it?
__________________
mmmm.... pudding
digby is offline  
Old 01-06-2006, 06:49 AM   #2 (permalink)
aka: freakylongname
 
Chamaeleontidae's Avatar
 
Location: South of the Great While North
Don't putting the alignment in the table tag. Leave the table tag without alignment, and then align the table as you would align text. Here is a link with some good information for you...

Code:
<p align="left">
<table border="1px" width="500">
	<tr>
		<td align="left" width="250"> Cell One</td>
		<td align="left" width="250"> Cell Two</td>
	</tr>
	<tr>
		<td align="left" width="250"> Cell Three</td>
		<td align="left" width="250"> Cell Four</td>
	</tr>
</table>
</p>
__________________
"Reality is just a crutch for people who can't cope with drugs."
Robin Williams.
Chamaeleontidae is offline  
Old 01-06-2006, 08:04 AM   #3 (permalink)
Crazy
 
Location: Ahh, the lovely South
Ah. I had tried the <p> tags around the paragraph, but it didn't work. That link however gave me what I was looking for:

Code:
<div align="right">
<table border="1px" width="500">
	<tr>
		<td align="left" width="250"> Cell One</td>
		<td align="left" width="250"> Cell Two</td>
	</tr>
	<tr>
		<td align="left" width="250"> Cell Three</td>
		<td align="left" width="250"> Cell Four</td>
	</tr>
</table>
</div>
That's what I wanted. Thanks!

A follow-up question: Is that usage of the <div> tag allowed in XHTML, or should I have defined that in CSS?
__________________
mmmm.... pudding

Last edited by digby; 01-06-2006 at 08:07 AM..
digby is offline  
Old 01-06-2006, 09:37 AM   #4 (permalink)
aka: freakylongname
 
Chamaeleontidae's Avatar
 
Location: South of the Great While North
I am not sure if the div tag is ok for XHTML 1.0 Strict Specification. The follow code is happy in the transitional spec...


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
</head>
<body>
<p>Hi there</p>
    <div style="text-align: right">
        <table border="1px" width="500" style="">
	        <tr>
		        <td align="left" width="250" style="height: 23px"> Cell One</td>
		        <td align="left" width="250" style="height: 23px"> Cell Two</td>
	        </tr>
	        <tr>
		        <td align="left" width="250" style="height: 23px"> Cell Three</td>
		        <td align="left" width="250" style="height: 23px"> Cell Four</td>
	        </tr>
        </table>
    </div>
<p>How are things going</p>
</body>
</html>
__________________
"Reality is just a crutch for people who can't cope with drugs."
Robin Williams.
Chamaeleontidae is offline  
Old 01-09-2006, 09:42 PM   #5 (permalink)
Crazy
 
Location: here and there
div is fine in xhtml, even encouraged.

<edit>oh, now i understand, is adding the alignment parameter allowed. not sure, but i would keep it in the css.</edit>
__________________
# chmod 111 /bin/Laden
theFez is offline  
 

Tags
html, keeping, running, table, text


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 07:41 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73