![]() |
[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? |
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"> |
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"> A follow-up question: Is that usage of the <div> tag allowed in XHTML, or should I have defined that in CSS? |
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"> |
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> |
All times are GMT -8. The time now is 08:38 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project